Program:
Output:
<!DOCTYPE html> <html> <head> <script type='text/JavaScript'> function updateList(ele) { with(document.forms.myform) { if(ele == 1) { list[0].text = "C"; list[0].value = 1; list[1].text = "Python"; list[1].value = 2; } else { list[0].text = "Oracle"; list[0].value = 1; list[1].text = "MySql"; list[1].value = 2; } } } </script> </head> <body> <form name="myform"> <select name="list" size="2"> <option value=1> C</option> <option value=1> Python</option> </select> <br><br/> <input type="radio" name="group1" value=1 checked="true" onclick="updateList(this.value)"> Programming Languages <input type="radio" name="group1" value=2 onclick="updateList(this.value)"> DataBases <br> <br> <input name="Reset" value="Reset" type="reset" /> </form> </body> </html>
Output: