Monday, May 13, 2024
 Popular · Latest · Hot · Upcoming
57
rated 0 times [  59] [ 2]  / answers: 1 / hits: 22613  / 15 Years ago, fri, august 14, 2009, 12:00:00

Given the following markup.



<div id=example>
<div>
<div>
<input type='hidden'></input>
</div>
</div>
</div>


How can I quickly get the hidden input element given I have the ID for the top most div element with the ID 'example'?



I can hack away at it so I can just iterate through each child element until I hit the input, however, I'd like to improve on that and utilize Prototype and simply jump to that hidden input given the div.



Thanks!


More From » prototypejs

 Answers
16
$$('#example input[type=hidden]').first()

[#98911] Tuesday, August 11, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
emilee

Total Points: 365
Total Questions: 113
Total Answers: 109

Location: Monaco
Member since Fri, Sep 24, 2021
3 Years ago
;