I am trying to get information from html elements within my page that are enclosed in a div. Here is some example html:
so what I need is to get the value of the input based on the "name" attribute of the input and the "id" attribute of the div.
basically something like this
obviously this doesn't work but I think it gets over what I want. I need a method of getting all of the elements named "input" within the div with the id of "div1
Code:
<div id="div1">
<input name="input" value="whatever">
</div>
<div id="div2">
<input name="input" value="more stuff">
</div>
so what I need is to get the value of the input based on the "name" attribute of the input and the "id" attribute of the div.
basically something like this
Code:
document.getElementById('div1').getElementsByName('input').value
obviously this doesn't work but I think it gets over what I want. I need a method of getting all of the elements named "input" within the div with the id of "div1