0

I am creating HTML button dynamically using jquery and adding that into a Panel .The number of button will vary as per the value in the database table.Now as per my requirement i need to get the name of submit button as soon as i click any of the button but i am not able to do it. Here is my jquery code..

obj = data.d;
var obj1 = obj.split(',');
for (var j = 0; j < obj1.length; j++) {
var h = "";
h += "<input type='button' class='btn btn-custom ' id='b1' value=" + obj1[j] + ">";
$('#p1').append(h);
}

and here is my button click event which is not working as required..

 $('#b1').click(function () {
 var ss = $(this).val();
 alert("ss ");
 });

Please help me ..Thanks

Radhey Pandey
  • 43
  • 1
  • 9

0 Answers0