sNiCKY
sNiCKY

Reputation: 1843

jQuery UI - I can't style checkbox button

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?

Upvotes: 3

Views: 3265

Answers (2)

sNiCKY
sNiCKY

Reputation: 1843

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');

Upvotes: 3

Ghyath Serhal
Ghyath Serhal

Reputation: 7632

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

Upvotes: 4

Related Questions