JQuery UI - I cannot set a button style

So, I have 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 style for #submit_button works fine, but I can’t create the style for # nextday_button..css (), it does not seem to work in this case. Am I doing something wrong in HTML?

+3
source share
2 answers

Well, thanks to Ghyath Serhal, I found that I cannot create a 'button' style like this:

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

because this code only puts a check in the box. I should stick a label instead, so I assigned the identifier to the label, and then changed JS to:

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

.Button(). $( "# nextday_button" ). Css ('font-size', '36px');

+4

Source: https://habr.com/ru/post/1776917/


All Articles