📄 select.html
字号:
<HEAD>
<TITLE>Netprog JavaScript Demos - Hot Select Menu</TITLE>
<H2>Use the select menu to pick a famous quote</H2>
<HR>
<FORM NAME=frm>
<TABLE>
<TR>
<TD VALIGN=TOP>Select a Person:
<SELECT Name=selector size=1 onChange="newquote()">
<OPTION VALUE=0 SELECTED>Yogi Berra
<OPTION VALUE=1>Bill Clinton
<OPTION VALUE=2>Cookie Monster
<OPTION VALUE=3>Dave H.
<OPTION VALUE=4>Anonymous Student
<OPTION VALUE=5>Kermit
</SELECT>
</TD>
<TD WIDTH=50> </TD>
<TD>
<TEXTAREA COLS=50 ROWS=5 NAME=quote>
</TEXTAREA>
</TD>
</TR>
</TABLE>
</FORM>
<SCRIPT>
quotes = new Array("The game isn't over til it's over",
"It depends on what the meaning\nof the word is is.",
"COOOOOOOKKKIIIEEE!",
"blah, blah, blah, blah, blah, blah, blah, blah\n" +
"foo\nblah, blah, blah, blah, blah, blah, blah, ...",
"I made cookies, but my dog ate them...",
"It's not easy being green"
);
function showquote(x) {
document.frm.quote.value='"'+quotes[x]+'"';
}
function newquote() {
index = document.frm.selector.selectedIndex;
author = document.frm.selector.options[index].value;
showquote(author);
}
newquote(0);
</SCRIPT>
<H2>Use this select to switch to a different JavaScript demo</H2>
<HR>
<FORM NAME=demoform>
<TABLE>
<TR>
<TD VALIGN=TOP>Select a Demo:
<SELECT Name=demoselector size=1 onChange="newdemo()">
<OPTION VALUE=0 SELECTED>Demo Home Page
<OPTION VALUE=1>Cookie Chase
<OPTION VALUE=2>Moving Browser
<OPTION VALUE=3>Active Bullets
<OPTION VALUE=4>Document Object Properties
<OPTION VALUE=5>Background Color
<OPTION VALUE=6>Back Button
<OPTION VALUE=7>DIVs
</SELECT>
</TD>
</TR>
</TABLE>
</FORM>
<SCRIPT>
urls = new Array("index.html","cookie.html","windowjump.html",
"activebullet.html", "props.html", "background.html",
"backbutton.html", "divs.html");
function gotourl(x) {
document.location= urls[x];
}
function newdemo() {
index = document.demoform.demoselector.selectedIndex;
num = document.demoform.demoselector.options[index].value;
gotourl(num);
}
</SCRIPT>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -