?? javascript8.htm
字號(hào):
<p align="justify"><img src="javascript/Bullet1.gif" tppabs="http://www.4gee.com/colleges/homepages/javascript/Bullet1.gif" width="13" height="13"
alt="Bullet1.gif (122 字節(jié))"><span style="color: rgb(125,125,125)" class="text"><font
lang="ZH-CN"> 功能:實(shí)施對(duì)具有口令輸入的元素的控制。</font></span></p>
<p align="justify"><img src="javascript/Bullet1.gif" tppabs="http://www.4gee.com/colleges/homepages/javascript/Bullet1.gif" width="13" height="13"
alt="Bullet1.gif (122 字節(jié))"><span style="color: rgb(125,125,125)" class="text"><font
lang="ZH-CN"> 屬性:</font></span></p>
<p align="justify"><span style="color: rgb(125,125,125)" class="text"><font lang="ZH-CN">Name:設(shè)定提交信息時(shí)的信息名稱,對(duì)應(yīng)HTML文檔中password中的name。</font></span></p>
<p align="justify"><span style="color: rgb(125,125,125)" class="text"><font lang="ZH-CN">Value:用以設(shè)定出現(xiàn)在窗口中對(duì)應(yīng)HTML文檔中Value的信息,對(duì)應(yīng)HTML文檔中password中的Value。</font></span></p>
<p align="justify"><span style="color: rgb(125,125,125)" class="text"><font lang="ZH-CN">defaultvalu:默認(rèn)值</font></span></p>
<p align="justify"><img src="javascript/Bullet1.gif" tppabs="http://www.4gee.com/colleges/homepages/javascript/Bullet1.gif" width="13" height="13"
alt="Bullet1.gif (122 字節(jié))"><span style="color: rgb(125,125,125)" class="text"><font
lang="ZH-CN"> 方法</font></span></p>
<p align="justify"><span style="color: rgb(125,125,125)" class="text"><font lang="ZH-CN">select():加亮輸入口令域。</font></span></p>
<p align="justify"><span style="color: rgb(125,125,125)" class="text"><font lang="ZH-CN">blur():使這丟失passward輸入焦點(diǎn)。</font></span></p>
<p align="justify"><span style="color: rgb(125,125,125)" class="text"><font lang="ZH-CN">focus():獲得password輸入焦點(diǎn)。</font></span></p>
<p align="justify"> </p>
</dir>
<p align="justify"><span style="color: rgb(125,125,125)" class="text"><font lang="ZH-CN"><b>9、submit提交元素</b></font></span></p>
<dir>
<p align="justify"><img src="javascript/Bullet1.gif" tppabs="http://www.4gee.com/colleges/homepages/javascript/Bullet1.gif" width="13" height="13"
alt="Bullet1.gif (122 字節(jié))"><span style="color: rgb(125,125,125)" class="text"><font
lang="ZH-CN"> 功能:實(shí)施對(duì)一個(gè)具有提交功能按鈕的控制。</font></span></p>
<p align="justify"><img src="javascript/Bullet1.gif" tppabs="http://www.4gee.com/colleges/homepages/javascript/Bullet1.gif" width="13" height="13"
alt="Bullet1.gif (122 字節(jié))"><span style="color: rgb(125,125,125)" class="text"><font
lang="ZH-CN"> 屬性:</font></span></p>
<p align="justify"><span style="color: rgb(125,125,125)" class="text"><font lang="ZH-CN">name:設(shè)定提交信息時(shí)的信息名稱,對(duì)應(yīng)HTML文檔中submit。</font></span></p>
<p align="justify"><span style="color: rgb(125,125,125)" class="text"><font lang="ZH-CN">Value:用以設(shè)定出現(xiàn)在窗口中對(duì)應(yīng)HTML文檔中Value的信息,對(duì)應(yīng)HTML文檔中value。</font></span></p>
<p align="justify"><img src="javascript/Bullet1.gif" tppabs="http://www.4gee.com/colleges/homepages/javascript/Bullet1.gif" width="13" height="13"
alt="Bullet1.gif (122 字節(jié))"><span style="color: rgb(125,125,125)" class="text"><font
lang="ZH-CN"> 方法</font></span></p>
<p align="justify"><span style="color: rgb(125,125,125)" class="text"><font lang="ZH-CN">click()相當(dāng)于按下submit按鈕。</font></span></p>
<p align="justify"><img src="javascript/Bullet1.gif" tppabs="http://www.4gee.com/colleges/homepages/javascript/Bullet1.gif" width="13" height="13"
alt="Bullet1.gif (122 字節(jié))"><span style="color: rgb(125,125,125)" class="text"><font
lang="ZH-CN"> 事件:</font></span></p>
<p align="justify"><span style="color: rgb(125,125,125)" class="text"><font lang="ZH-CN">onclick()當(dāng)按下該按鈕時(shí),產(chǎn)生該事件。</font></span></p>
<p align="justify"> </p>
</dir>
<p><span style="color: rgb(125,125,125)" class="text"><font lang="ZH-CN"><b>三、范例</b></font></span><dir>
<dir>
<p><span style="color: rgb(125,125,125)" class="text"><font lang="ZH-CN">下面我們演示通過(guò)點(diǎn)擊一個(gè)按鈕(red)來(lái)改變窗口顏色,點(diǎn)擊“調(diào)用動(dòng)態(tài)按鈕文檔”調(diào)用一個(gè)動(dòng)態(tài)按鈕文檔。</font></span></p>
<pre><span style="color: rgb(125,125,125)" class="text"><font lang="ZH-CN">
</font><b>test8_1.htm
</b><html>
<head>
<Script Language="JavaScript">
//<font
lang="ZH-CN">原來(lái)的顏色
</font>document.bgColor="blue";
document.vlinkColor="white";
document.linkColor="yellow";
document.alinkcolor="red";
//<font
lang="ZH-CN">動(dòng)態(tài)改變顏色
</font>function changecolor(){
document.bgColor="red";
document.vlinkColor="blue";
document.linkColor="green";
document.alinkcolor="blue";
}
</script>
</HEAD>
<body bgColor="White" >
<A href="test8_2.htm"> <font
lang="ZH-CN">調(diào)用動(dòng)態(tài)按鈕文檔</font></a>
<form >
<Input type="button" Value="red" onClick="changecolor()">
</form>
</BODY>
</HTML>
<font
lang="ZH-CN">輸出結(jié)果見(jiàn)圖</font>1<font lang="ZH-CN">所示。
</font><img
src="javascript/Image6.gif" tppabs="http://www.4gee.com/colleges/homepages/javascript/Image6.gif" width="398" height="264" alt="Image6.gif (12606 字節(jié))">
<font
lang="ZH-CN">
</font> <font lang="ZH-CN">圖</font>1
<font lang="ZH-CN">
動(dòng)態(tài)按鈕程序。
</font> <b>test8_2.htm
</b><HTML>
<HEAD>
</HEAD>
<p align="center"><font
lang="ZH-CN"> </font></p>
<div align="center"><center>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><form name="form2" onSubmit="null">
<p><input type="submit" name="banner" VALUE="Submit"
onClick="alert('You have to put an \'action=[url]\' on the form
tag!!')"> <br>
<script language="JavaScript">
var id,pause=0,position=0;
function banner() {
// variables declaration
var i,k,msg=" <font
lang="ZH-CN">這里輸入你要的內(nèi)容</font>";// increase msg
k=(30/msg.length)+1;
for(i=0;i<=k;i++) msg+=" "+msg;
// show it to the window
document.form2.banner.value=msg.substring(position,position-30);
// set new position
if(position++==msg.length) position=0;
// repeat at entered speed
id=setTimeout("banner()",60); }
// end -->
banner();
</script></p>
</form>
</td>
</tr>
</table>
</center></div>
<p><font
lang="ZH-CN"> </font></p>
<BODY>
<A href="test8_1.htm"> <font
lang="ZH-CN">返回</font></a>
</BODY>
</HTML>
<font lang="ZH-CN">輸出結(jié)果見(jiàn)圖</font>2<font
lang="ZH-CN">所示。
</font></span><img src="javascript/Image5.gif" tppabs="http://www.4gee.com/colleges/homepages/javascript/Image5.gif" width="398" height="264"
alt="Image5.gif (12807 字節(jié))"></pre>
<dir>
<dir>
<dir>
<dir>
<dir>
<dir>
<p align="justify"><span style="color: rgb(125,125,125)" class="text"><font lang="ZH-CN">圖2</font></span></p>
<p align="justify"> </p>
</dir>
</dir>
</dir>
</dir>
</dir>
</dir>
</dir>
</dir>
<p align="justify"><span style="color: rgb(125,125,125)" class="text"><font lang="ZH-CN">本講介紹了使用JavaScript腳本實(shí)現(xiàn)Web頁(yè)面信息交互的方法。其中主要介紹了窗體中的基本元素的主要功能和使用。</font></span></td>
</tr>
</table>
<p align="center"><small><a href="JavaScript7.htm" tppabs="http://www.4gee.com/colleges/homepages/JavaScript7.htm">上一頁(yè)</a>
<a href="JavaScript9.htm" tppabs="http://www.4gee.com/colleges/homepages/JavaScript9.htm">下一頁(yè)</a></small></p>
</body>
</html>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -