javascript - Selecting DOM elements based on ID values -
i have textboxes in dom someting
<input id=txtquantity587117 /> <input id=txtquantity587118 /> <input id=txtquantity587119 /> <input id=txtquantity587111 /> <input id=txtquantity587112 />
the elements nested , not under particular parent node.
is there way select input elements id text starts "txtquantity".
i want way javascript , not jquery. thanks.
in modern browsers (and ie8... now verified) can use document.queryselectorall()
attribute-starts-with
selector.
var els = document.queryselectorall("input[id^=txtquantity]");
Comments
Post a Comment