How to run getElementsByTagName on children of an element only?
问题 I'm having trouble getting a selector to work properly. I have this HTML: <div.wrapper> <div.ui-controlgroup-controls> <form> <div.ui-btn></div> </form> <div.ui-btn></div> <div.ui-btn></div> <div.ui-btn></div> <div.ui-btn></div> </div> </div> and I'm trying to select the div tags, which are children of ui-controlgroup-controls - which means excluding whats inside the form. This is what I'm trying: // el is my div.wrapper element el.children[0].getElementsByTagName("div"); However this does