I'm trying to call many button by one jquery function. following is my html and php code:
Elements of button:
for($q_no=1;$q_no<=30;$q_no++){
echo('<button class="q_no_btn" id="'.$q_no.'">Question no '.$q_no.'</button>');
}
My Jquery code:
$(document).ready(function(){
var q_no;
for(q_no=1;q_no<=30;q_no++){
$("#"(q_no).click(function(){
alert("Click on 1!!!");
}))
}
});
I'm poping up the content to popup box, by clicking on the buttons.
please help.