javascriptÎÊÌâ
HTML code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ÎÞ±êÌâÎĵµ</title>
<style type="text/css">
li{border:1px solid #f30;list-style:none;margin:3px; cursor:pointer}
</style>
</head>
<body>
<ul id="show">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
</ul>
</body>
<script language="javascript">
function show(){
var a=document.getElementById("show").getElementsByTagName("li");
for(var i=0;i<a.length;i++){
a[i].onclick=function(){
alert(i)
}
}
}
show()
</script>
</html>
µã»÷"li"µÄʱºòÎÒÔ±¾´òËãÊÇÈÃËü·Ö±ðµ¯³öiµÄÖµ(1,2,3,4)£¬¿ÉÊÇËüÀÏÊǵ¯³ö4,Ò²¾ÍÊÇa.lengthµÄÖµ,ÕâÊÇΪʲô°¡£¿
ÒòΪ i ×îºóµÄÖµÊÇ 4
¸Ä³ÉÏÂÃæµÄ¾Í¶ÔÁË
a[i].onclick = new Function("alert(" + i + ")");
Â¥Ö÷ÕâÑù¾Í¿ÉÒÔÁË
JScript code
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHig
Ïà¹ØÎÊ´ð£º
ÎÒµÄÔ´ÎļþÈçÏ£º
<html>
<head> <title>show picture </title>
<script>
function change(fileName)
{
  ......
ÒÔÏÂÊÇÒ»¶ÎJavsScript½Å±¾£¬µ«ÔËÐÐʱ×Ü»á²úÉú ¡°Microsoft JScript ÔËÐÐʱ´íÎó: 'null' Ϊ¿Õ»ò²»ÊǶÔÏó¡±Òì³££¬´ó¼Ò°ï¿´Ò»Ï¡£
<form id="form1" runat="server">
< ......
ÉÏÁª£ºJavaºÍJavaScript
×Ô¼ºÊÔÊÔ£º
ÏÂÁª£ºÃæ°üºÍÃæ°ü³µ
ÏÂÁª£ºSQLºÍMySQL
ºÇºÇ¡£
me and myself
ÏÂÁª£ºJavaScriptºÍJava
ÍÃ×ÓºÍÍÃ×Óʺ£¡
£¡
ÔÙÀ´Ò»¸ö£ºCºÍC++
ÒýÓÃ
ÏÂÁª£ºJavaScriptºÍJav ......
ÇóÒ»¸öjavascript½Å±¾..
µ±µã»÷Õâ¸ö<a>Ìí¼Ó¸½½ü</a>Á´½Óʱ¾Í»áÌí¼Ó¶àÒ»ÐÐÉÏ´«¿òºÍ°´Å¥,ºÍ×îºóÒ»¸öÅԱ߻áÏÔʾ"È¡Ïû"µÄÁ´½Ó,µã»÷Õâ¸öÈ¡Ïû¾Í»áÈ¥µô×îºóÒ»ÐÐ,Ò»¸öÕâ¸ö½Å±¾Ôõôд?Íò·Öлл..
Ò ......