看板Programming
标 题Re: [问题] 请教一个 JavaScript 跟浏览器的问题
发信站白色情迷 (Mon Oct 23 16:56:20 2006)
转信站ptt!ctu-reader!Spring!news.nctu!news.ntu!mars.scc.ntnu!snowBBS
※ 引述《[email protected] (啦 )》之铭言:
> function Determine4() {
> switch(document.form.education.selectedIndex) {
> case 1:
> var school = prompt("请输入您的学校:", "");
> if(school) {
> document.form.school.options[0] = Option(school, school);
document.form.school.options[0] =
new Option(school, school);
> document.form.school.selectedIndex = 0;
> }
> break;
> }
> }
> </script>
在 Option 前加上 new 就行了。
dreamer. =)
--
╭╢师大资讯。白色情迷╟┬─ ⊙ Origin : snow.ice.ntnu.edu.tw
├╨→ 140.122.77.49←╜╰─ ☆ From : alg.csie.ntnu.edu.tw