KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Possible Duplicate: Get list of all input objects using JavaScript, without accessing a form object How can I get elements, like all buttons on a page, without class or ID? Is there anything like this? document.getElementsByType(button) EDIT My confusion was how to get all buttons (not just one) without class or ID. the solution ended up being var buttons = document.getElementsByTagName('button'); for (var i = 0, len = buttons.length; i < len; ++i) { but your answer is what led me to find out what I didn't know to ask in the first place... So, thanks everyone!
Tags (comma-separated)
Save Edits
Cancel