how to break chaining selectors in jquery -
i have doubts in break jquery chaining selectors.
for example, consider sample code,
<script> $("#button1, #button2, #button3, #button4, #button5, #button6 ").show(); </script> i want change format,
<script> $("#button1, #button2, #button3, #button4, #button5, #button6 ").show(); </script> please help. in advance..
we pass string jquery selector function. difference in above 2 in first string formed , in second have concatenate otherwise error. can concatenate this,
$("#button1, #button2, \ #button3, #button4, \ #button5, #button6 ").show(); or
$("#button1, #button2,"+ "#button3, #button4, "+ "#button5, #button6 ").show(); you can assign common class buttons , use class selector show hide them.
$('.button-class').show(); you can use attribute selector using wild card starts with if have pattern ids given in question.
$('[id^=button]).show();
Comments
Post a Comment