I saw a similar post here, however I want to do something similar using javascript. Basically there a method to grab all user input in some container such as a div or form
<form>
<div>
<text>
</div>
<div>
<textarea>
</div>
<div>
<select>
</div>
</form>
An example would be to grab text, textarea, select, and other forms of user input. I saw something like
var elements = document.myform.getElementsByTagName("input")
But it wouldn't work for selects. I know I could possibly just have a duplicate method which attempts to find ("select") but what if the form must keep the order in which user put in information.
EDIT: Thank you for all the responses. Does all the methods mentioned so far only work if the inputs are direct descendants or is there some other method?