Traversing Form's inputs in Jquery

Well, I also do some 2.0 stuff since I have been working in a web project for quite a long time, which I hope to release soon.

One problem I found was accessing all the inputs in a form, knowing the ID, even those under divs tag inside the form.

Something like the following:

<form id="myform">
  <input />
  <div>
    <input />
  </div>
  <div>
    <input />
  </div>
</form>

After trying different combinations and asking around I found the right expression to traverse all the inputs was the next one:

$("#myform input").each(function() {
  //do whatever you need
});