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

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

PDF Print E-mail

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

 

Answer: 

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

+/-
+/- Write comment
Your Contact Details:
Comment:
[b] [i] [u] [url] [quote] [code] [img]   
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
Security Please input the anti-spam code that you can read in the image.
 
 
Banner