3

So Im having a problem with the button() function.

HTML:

<input id="nextday_button" name="nextday" type="checkbox" value="true" /><label for="nextday_button">yes</label> 
<input id="submit_button" name="commit" type="submit" value="Check" />

JS:

$("#nextday_button").button().css('font-size','36px');
$("#submit_button").button().css({'font-size':'22px', 'padding': '3px 12px 3px 12px'});

The styling for the #submit_button is working perfectly, but I cant style the #nextday_button. .css() seems not working in this case. Am I doing something wrong in the HTML?

2 Answers 2

4

Try to remove the .Button(). Try this $("#nextday_button").css('font-size','36px');

Sign up to request clarification or add additional context in comments.

Comments

3

Ok, thanks to Ghyath Serhal I found that I can't style the 'button' itself this way:

$("#nextday_button").button().css('font-size','36px');

because this code is only styling the checkbox. I should style the label instead, so I assigned an ID to the label and then changed the JS to:

$("#nextday_button").button();
$("#nextday_label").css('font-size', '36px');

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.