you can make selection as follow:
var input = document.getElementsByTagName("INPUT");
var j = 0;
for (var i = 0; i < input.length; i++) {
if (input[i].type == "text") {
if (input[i].value == "First") {
input[i].value == "Second"
}
}
}
or if you know the index of that element in dom you can directly do this as follow:
<HTML>
<FORM>
<input id='random_value' name='random_name' value='First'/>
<input id='random_value' name='random_name' value=''/>
</FORM>
</HTML>
you can set value as follow:
document.forms[0].elements[0].value=document.forms[0].elements[1].value;
if the form is first and text box is the first element of the form else you can specify the index of that instead.
if you dont know the index then you can go through the loop of all elements and check the value "First" and get it done.