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

H

How Can We Help?

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

About the author

Ian Carnaghan

I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment.

About Author

Ian Carnaghan

I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment.

Follow Me