JavaScriptÈ¡µÃselect option value
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<mce:style type="text/css"><!--
div#show { float: right; color: blue; }
--></mce:style><style type="text/css" mce_bogus="1">
div#show { float: right; color: blue; }
</style>
</HEAD>
<BODY>
<form id="form" method="post">
<table>
<tr>
<td>ÃüÁ</td>
<td>
<div>
<SELECT name="ftpcmd" onchange="SelectValue()">
<OPTION value="STOU">STOU</OPTION>
<OPTION value="RETR">RETR</OPTION>
</SELECT>
</div>
</td>
<td width="50"> <div id="show"></div></td>
</tr>
</table>
<input type=button onclick="selectValue()" value="Ñ¡Ôñ">
</form>
</BODY>
</HTML>
<mce:script language="javascript"><!--
function selectValue()
{
if(window.form.ftpcmd[window.form.ftpcmd.selectedIndex].value=="STOU"){
document.getElementById("show").innerHTML="ÉÏ´«";
alert("ÉÏ´«");
}
if(window.form.ftpcmd[window.form.ftpcmd.selectedIndex].value=="RETR")
{
document.getElementById("show").innerHTML="ÏÂÔØ";
alert("ÏÂÔØ");
}
}
// --></mce:script>
Ïà¹ØÎĵµ£º
·½·¨Ò»£º
Js_file01.js
========
//³ÌÐò´úÂë
document.write(" <script language=\"javascript\" src="\/com\/ Js_file02.js \" > <\/script>");
·½·¨¶þ£º
html´úÂë
³ÌÐò´úÂë
<html>
<body>
<input type="button" value="ok" onclick="ja ......
ÎÒ½ñÌìѧϰÁËÙ¡ÀÏʦ½²µÄJavaScript½âÎöDomÎĵµµÄ֪ʶ£º
Ò»¡¢ ½Úµã·ÖΪ3ÖÖÀàÐÍ£¬ÔªËؽڵ㣬ÊôÐԽڵ㣬Îı¾½Úµã
¶þ¡¢ ²éÕҽڵ㣺
l js´úÂë²»ÄÜдÔÚbodyÔªËصÄÇ°Ã棬js ´úÂëдÔÚ <head> ½ ......
JavaScript δ½áÊøµÄ×Ö·û´®³£Á¿
×öJavaScriptµÄʱºò,·¢ÏÖÀÏÊdzöÏÖ´íÎ󣺓δ½áÊøµÄ×Ö·û´®³£Á¿”.
×Ô¼ºÕÒÁËÏÂÓ¦¸ÃÊÇ´«²ÎÊýµÄʱºò,ÓÐÌØÊâ×Ö·ûÒýÆðµÄ.
ÍøÉÏÒ²ÕÒÁËÏÂ,Ò²Óкöà³öÏÖÕâÖÖÇé¿ö.×öÏÂ×ܽá,ÒÔ·½±ãÒÔºó²éÔÄ.
1.JAVASCRIPTÒýÓÃʱ,ʹÓõÄ×Ö·ûÓïÑÔ²»Ò»ÖÂ.
±ÈÈç:<script type=”text/javascrip ......
¡¡¡¡ºÜ¶àÈ˶¼ÓùýAJAX¿Ø¼þ°É£¬AJAX¿Ø¼þ²»ÐèҪˢÐÂÒ³Ãæ¾Í¿ÉÒÔµ½ºǫ́ȥ¶Á³öÊý¾Ýµ½¿Í»§¶Ë£®AJAX¿Ø¼þ³ýÁËÓкÜìŵÄÌØЧÍ⣬ÆäÒª¹¦ÄܾÍÊDz»ÐèҪˢÐÂÕû¸öÒ³Ãæ¾Í¿ÉÒÔÈ¡µÃÓû§ËùÐèÒªµÄÊý¾Ý£¬ÎÒ°ÑÕâÒ»¿éµÄµÄ¹¦ÄÜ·â×°³ÉÒ»¸öÀ࣬·½±ãÈÕºó¿ÉÒÔÖظ´Ê¹Ó㬴úÂëÈçÏ£º
//Ajax Request Class Start
functio ......
ÎÒÔÚjsÖж¨ÒåÁËÒ»¸öº¯Êý£º
function closeCodeList()
{
try
{
showFistIndex = 0;
arrayBmCode = null;
if(document.all("spanCode").style.display=='')
{
var disFlag=1;
}
document.all("spanCode").style.display='none';
try{if(disFlag)oldFieldKey.focus();}catch(ex){}
}
c ......