brand
second item
brand
IBM
that item
will
select IBM
too brand
HP
that item
will
select HP
tooHow to do that in javascript.
<select name="brand">
<option>Please Select</option>
<option>IBM</option>
<option>HP</option>
</select>
<select name="item">
<option>Please Select</option>
<option>IBM</option>
<option>HP</option>
</select>
I noticed your options line up with one another, so you could simply reflect the selectedIndex in in the second from the first:
document.getElementById("brand").onchange = function(){
document.getElementById("item").selectedIndex = this.selectedIndex;
}