How to get the attribute name value of a input tag using jquery. Please help.
<input name='xxxxx' value=1>
How to get the attribute name value of a input tag using jquery. Please help.
<input name='xxxxx' value=1>
Give your input an ID and use the attr method:
var name = $("#id").attr("name");
You need to write a selector which selects the correct <input> first. Ideally you use the element's ID $('#element_id'), failing that the ID of it's container $('#container_id input'), or the element's class $('input.class_name').
Your element has none of these and no context, so it's hard to tell you how to select it.
Once you have figured out the proper selector, you'd use the attr method to access the element's attributes. To get the name, you'd use $(selector).attr('name') which would return (in your example) 'xxxxx'.