I have one HTML button like,
$('element[name="element_name"]').click(function(){
//do stuff
});
in your case:
$('input[name="btnName"]').click(function(){
//do stuff
});
You have to use the jquery attribute selector. You can read more here:
http://api.jquery.com/attribute-equals-selector/
In your case it should be:
$('input[name="btnName"]')
You can use the name property for that particular element. For example to set a border of 2px around an input element with name xyz, you can use;
$(function() {
$("input[name = 'xyz']").css("border","2px solid red");
})
DEMO
You can use normal CSS selectors to select an element by name using jquery. Like this:
Button Code
<button type="button" name="mybutton">Click Me!</button>
Selector & Event Bind Code
$("button[name='mybutton']").click(function() {});