button disable test

by hiteshbhilai2010

HTML

<table border="1">
<tr>
<td><button class = "btn" id = "click1">button1</button></td>
<td><button class = "btn" id = "click2">button2</button></td>
</tr>
<tr>
<td><button class = "btn" id = "click3">button3</button></td>
 </tr>
</table>

JavaScript

//for <button> tags --> pls uncomment below line 
 // $(":button").attr("disabled", "disabled");


$(":button").click(function(){
alert(this.id);
})


//Even your code works !!!! ---> uncomment below lines to see

$(":button").each(function () {
   //$(this).attr("disabled", true);
});