次のようにコードコードをコピーします。
<!doctype html>
<html>
<head>
<title> select.html </title>
<meta http-equiv = "keywords" content = "keyword2、keyword3">
<メタhttp-equiv = "description" content = "これは私のページ" >>
<メタhttp-equiv = "content-type" content = "text/html; charset = utf-8">
<! - <link rel = "styleSheet" type = "text/ css" href = "./ styles.css"> - >
</head>
<body>
<select id = "mycourse" onchange = "getCourse();">
<オプション値= "" select> - コースを選択してください</option>
</select>
<textarea id = "myares" rows = "10" cols = "30"> </textarea>
<script type = "text/javascript" type = "text/javascript">
<! -
var last_select_num = 3;
//最初のコースを動的に追加します
var myoption = document.createelement( "option");
myoption.value = "java";
myopting.text = "java";
mycourse.add(myoption);
// 2番目のコースを動的に追加し、
myoption = document.createelement( "option");
myoption.value = "oracle";
myopting.text = "oracle";
myCourse.add(myOption);
//动态添加第三门课程、
myOption = document.createElement("option");
myOption.value = "javaEE";
myopting.text = "javaee";
mycourse.add(myoption);
関数getCourt(){{)
myares.value += "あなたは選択しました:" +mycourt.value +"/r/n";
}
- >
</script>
</body>
</html>