How to access repeater items from JavaScript
I've got a hidden control inside a r开发者_JAVA技巧epeater. How can I access this from JavaScript?
Are you using JQuery? This can be easily done by the following:
$("#<%= Repeater1.ClientID %>").find("input[type='hidden']")
Which scours the entire repeater; because each item doesn't render a wrapper around it (a div or a table, for example), the find does an entire check of the HTML tree. Otherwise, you'd have to loop through each element, or wrap each item with a DIV, and access the childNodes collection of that DIV, and it would be more of a pain without JQuery, but very possible.
HTH.
精彩评论