Copy Code code as follows:
<! DOCTYPE html>
<title>select.html</title>
<meta http-equiv= "keywords" content= "keyword1,keyword2,keyword3" >
<meta http-equiv= "description" content= "This are my page" >
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">
<!--<link rel= "stylesheet" type= "Text/css" href= "./styles.css" >-->
<body>
<select id = "Mycourse" onchange = "getcourse ();" >
<option value = "" selected>--Please select a course--</option>
</select>
<textarea id = "Myares" rows= "ten" cols= "></textarea>"
<script type= "text/javascript" type = "Text/javascript" >
<!--
var last_select_num = 3;//Join query from database
Add the first course dynamically
var myoption = document.createelement ("option");
Myoption.value = "Java";
Myoption.text = "Java";
Mycourse.add (myoption);
Add a second course dynamically,
Myoption = document.createelement ("option");
Myoption.value = "Oracle";
Myoption.text = "Oracle";
Mycourse.add (myoption);
Dynamically adding a third course,
Myoption = document.createelement ("option");
Myoption.value = "Java ee";
Myoption.text = "Java ee";
Mycourse.add (myoption);
function GetCourse () {
Myares.value + + "You chose:" +mycourse.value + "\ r \ n";
}
-->
</script>
</body>