You should use attr('name') like this
$('#yourid').attr('name')
you should use an id selector, if you use a class selector you encounter problems because a collection is returned
You should use attr('name') like this
$('#yourid').attr('name')
you should use an id selector, if you use a class selector you encounter problems because a collection is returned