tarnfeld tarnfeld - 4 months ago 9
HTML Question

How to gain access to an element on the same level in the DOM?

<div id="dad">
<img id="mum">
<input>
</div>


With jQuery, how could i get access to the input element, get is value or set it for example? I can't work out how to access something on the same level.. and i dont want to be using ID's, just parent/child nodes so i can use the code for loads of dad div's

Thanks!

Answer
var myEl = $("#dad").children(":input");