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

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" />

Image Credits: Photo by Isis França on Unsplash.

More Similar Posts

No results found.

Menu