SyntaxFix
Write A Post
Hire A Developer
Questions
Use the attr method of jQuery like this:
attr
alert($('input').attr('name'));
Note that you can also use attr to set the attribute values by specifying second argument:
$('input').attr('name', 'new_name')