This should be real easy. How to find a button through its Value (Jquery Selector)
- by Raja
I have this HTML:
<div id='grid'>
<input type="button" value="edit"/>
<input type='button' value='update'/>
</div>
How to I attach a click event only to Update button. I know I could add a class to it or specity an id but both are not possible since it is in gridview.
I tried this:
$("input:button[@value='update']").click(function(){alert('test');});
but it displays an alert for both buttons. I know I must be doing something silly. Any help is much appreciated.
Thanks Kobi for helping me out. Given below is the right answer.
$("input[value='update']").click(function(){alert('test');});