In fact, I am working on a small PHP script.On a page the PHP generates code like this :
<div id="ya">sjaka</div>
<p id="ya"><input id="color" type="text" value="text1"></input></p>
<span id="ya"><input id="color" type="text" value="text2"></input></span>
What i want is that to get the value of the input inside the span with the id ya.for that reason i am using this js code :
x = document.getElementById("ya");
color = x.querySelector("#color").value;
But it doesn't seem to work it returns the result inside the P tag.How can I achieve this ?