How to get the value of an HTML element by the attribute name instead of the attribute id using JQuery

6 sec read

This can be accomplished by using the name attribute selector

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

ElementName is the attribute name of the element

<input type="text" name="ElementName" />

Last Updated On March 21, 2018

Leave a Reply

avatar
  Subscribe  
Notify of