<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>test Child</title> <script type="text/javascript">
function updateModel() { var models = document.getElementById("model"); while(models.childNodes.length>0) { models.removeChild(models.childNodes[0]); } var models = document.getElementById("model"); var option = document.createElement("option"); option.appendChild(document.createTextNode("The peple's Republic of China")); option.setAttribute("value","China"); models.appendChild(option);
var option = document.createElement("option"); option.setAttribute("value","American"); option.appendChild(document.createTextNode("The united states of American")); option.setAttribute("value","America"); models.appendChild(option); } function changeEvent() { var objSelect =document.getElementById("model"); alert( objSelect.options[objSelect.selectedIndex].value); }