javascriptʵÏÖ×Ô¶¯ÇóºÍ
function total(){
var i=0;
for(j=1;j<=20;j++)
{
var step="step"+j;
if(document.getElementById(step)){
if(document.getElementById(step).checked==true)
{
i=i+parseInt(document.getElementById(step).value);
}
}
}
document.getElementById("total").innerHTML = i;
}
function Resetvalue(){
for(j=1;j<=20;j++)
{
if(document.getElementById("step"+j)!=null){
document.getElementById("step"+j)&0;}
document.getElementById("total").innerHTML = "0";}
}
function allselect()
{
for(j=1;j<=20;j++)
{
if(document.getElementById("step"+j)!=null){
document.getElementById("step"+j).checked=true;}
}
var ischecked=0;
var obj=document.getElementById("thisform");
for(k=0;k<obj.vom.length;k++)
{
if(obj.vom[k].checked)
ischecked=1;
}
if(ischecked==0)
{
obj.vom[1].checked=true;
}
total();
}
html²¿·Ö
<form name="thisform">
<input name="step1" type="checkbox" value="1" onClick="total()"/>1<br/>
<input name="step2" type="checkbox" value="2" onClick="total()"/>2<br/>
<input name="step3" type="checkbox" value="3" onClick="total()"/>3<br/>
<input name="step4" type="checkbox" value="4" onClick="total()"/>4<br/>
<input name="step5" type="checkbox" value="5" onClick="total()"/>5<br/>
<input name="step6" type="checkbox" value="6" onClick="total()"/>6<br/>
<div id="total" >0</div>
<input type="button" name="Submit2" value="ȫѡ" onclick="allselect()" >
<input type="reset" name="Submit2" value="ÖØÖÃ" onclick="Resetvalue()" >
</form>
---------------------------------HTML²¿·Ö2£¬ÕâÊÇÎÒ¼ÓÉÏÈ¥µÄ£¬Ö»×ö²Î¿¼¡£
<SCRIPTLANGUAGE=javascript> function sumNum() {var number1= isNaN(parseInt(num1.value,10))?0:parseInt(num1.value,10);var number2= isNaN(parseInt(num2.value,10))?0:parseInt(num2.value,10);var number3= isNaN(pars
Ïà¹ØÎĵµ£º
µÚÈýÕ DOM Scripting DOM±à³Ì
DOM scripting is expensive, and it's a common performance bottleneck in rich web applications. This chapter discusses the areas of DOM scripting that can have a negative effect on an application's responsiveness and gives recommendations o ......
function db()
{
//»î¶¯±àºÅ
var activeid = Request.Form("activeid");
//Óû§Ãû
var username = Request.Form("username");
//ÊÖ»úºÅÂë
var mobile = Request.Form("mobile");
var conn= Server.CreateObject("ADODB.connection");
var rs= Serve ......
JavaScriptʼþ´óÈ«
click() ¶ÔÏó.click() ʹ¶ÔÏó±»µã»÷¡£
closed ¶ÔÏó.closed ¶ÔÏó´°¿ÚÊÇ·ñÒѹرÕtrue/false
clearTimeout(¶ÔÏó) Çå³ýÒÑÉèÖõÄsetTimeout¶ÔÏó
clearInterval(¶ÔÏó) Çå³ýÒÑÉèÖõÄsetInterval¶ÔÏó
confirm("ÌáʾÐÅÏ¢") µ¯³öÈ·ÈÏ¿ò£¬È·¶¨·µ»ØtrueÈ¡Ïû·µ»Øfalse
cursor:Ñùʽ ¸ü¸ÄÊó±êÑùÊ ......
£¼script language="javaScript"£¾
function closeWindow()
{
¡¡window.opener = null;
¡¡window.open(' ', '_self', ' ');
¡¡window.close();
}
£¼/script£¾
£¼input type='button' value='¹Ø±Õ´°¿Ú' onClick="closeWindow()"£¾
»ò
£¼input type="button" value="¹ ......