看板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