I need to create 10 buttons dynamically with Jquery and set the text on them to be 1 -10, and add the same click event to all of them.
Should I be using dom create e
try this:
var something = $('').attr({ type: 'button', name:'btn1', value:'a button' });
now append this to your div (in this example, it has the id "item"):
$("#item").append(something);
of course, for dynamic values, you need to do it inside a loop with iterated values of the name or ID field of the button..
hope explaining the concept helps :)