How to get a value of an element by name instead of ID

Total Post:1

Points:7
JQuery 
 435  View(s)
Ratings:
Rate this:

I want to get value of element by using its name .I have done by using id

$('#id').val();


  1. Post:1

    Points:7
    Re: How to get a value of an element by name instead of ID

    Hi, Ramesh

    You can do this by using the name attribute selector:

    $("input[name=nameGoesHere]").val();

Answer