What\'s the easiest way to get all input fields inside a div without using a javascript library like jQuery? Similar to this jQuery snippet:
var inputs = $(\
querySelector and querySelectorAll will fetch the details of what you're expecting easily.
querySelector
querySelectorAll
var divElem = document.getElementById("myDiv"); var inputElements = divElem.querySelectorAll("input, select, checkbox, textarea");
It will give all the input, select, textarea elements in array format.