HTML drop down javascript help needed -
i have 2 html drop down
<select> <option value="">please select</option> <option value="volvo">volvo</option> <option value="saab">saab</option> <option value="mercedes">mercedes</option> <option value="audi">audi</option> </select> <select> <option value="">please select</option> <option value="a">a</option> <option value="b">b</option> </select>
now, if select volvo first drop down , b second dropdown , change audi in first dropdown, want value of second drop down show please select instead of b (selected previously) using javascript
ps: new javascript
it's easy as:
<select onchange="document.getelementbyid('secondoption').selectedindex = 0;"> <option value="">please select</option> <option value="volvo">volvo</option> <option value="saab">saab</option> <option value="mercedes">mercedes</option> <option value="audi">audi</option> </select> <select id="secondoption"> <option value="">please select</option> <option value="a">a</option> <option value="b">b</option> </select>
Comments
Post a Comment