I am trying to get the name's value from an input HTML element using jQuery but it doesn't works.
HTML code:
<p class="myclass"><input type="text" name="thisismyname1" value="123"></p> <p class="myclass"><input type="text" name="thisismyname2" value="456"></p> <p class="myclass"><input type="text" name="thisismyname3" value="789"></p>
I am trying to get all the name values using this peace of code in jQuery:
$(.myclass).each(function(value){ alert('input name='+ $(this).attr('name') +'='+$(this).val()); });
This $(this).attr('name') seems not to be working.