var allchk = document.getElementsByName("contacts")
what is "contacts" in above line
rsridhar420 0 Newbie Poster
Recommended Answers
Jump to PostContacts is our html element name ..
Your element will be like this <input type = "text" name = "contacts" />
Jump to PostTo clarify... There are some confusing responses in this thread. The OP is asking about getElementsByName not getElementById.
document.getElementsByName() returns a HTMLCollection of all the elements with a given value for the name attribute, commonly used when targeting input elements.
All 5 Replies
Shinedevil 8 Junior Poster in Training
IIM 163 Master Poster
imBaCodes 2 Junior Poster
JorgeM 958 Problem Solver Team Colleague Featured Poster
IIM 163 Master Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.