27.过10秒自动关闭页面 < script language="JavaScript" > function closeit() { setTimeout("self.close()",10000) } < /script > 28.可以比较字符的大小 char=post.charAt(i); if(!('0'<=char&&char<='9')) 29.将字符转化为数字 month = parseInt(char) 30.点击value非空的选项时转向指定连接 <select onchange='if(this.value!="")window.open(this.value)' class="textinput"> <option selected>主办单位</option> <option>-----------------</option> <option value="http://www.bjd.com.cn/">北京日报</option> <option value="http://www.ben.com.cn/">北京晚报</option> </select> 31.改变背景颜色 <td width=* class=dp bgColor=#FAFBFC onmouseover="this.bgColor='#FFFFFF';" onmouseout="this.bgColor='#FAFBFC';"> 32.改变文字输入框的背景颜色 <style> .input2 {background-image: url('../images/inputbg.gif'); font-size: 12px; background-color: #D0DABB;border-top-width:1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px} </style> <input name=content type=text size="47" class="input2" maxlength="50"> 33.改变水平线的特征 <hr size="0" noshade color="#C0C0C0"> 34.传递参数的方式 <a href="vote.asp?CurPage=8&id=3488">8</a> 35.页内跳转 <a href="#1">1</a> <a href="#2">2</a> <a href="#3">3</a> <a href="#4">4</a> <a href="#5">5</a> <a href="#6">6</a> <a href="#7">7</a> <a name="1">dfdf</a> <a name="2">dfdf</a>// 36.两个按键一起按下 if(event.ctrlKey && window.event.keyCode==13)// 37.刷新页面 javascript:this.location.reload()// 38.将网页的按钮使能 <SCRIPT LANGUAGE="JavaScript"> function haha() { for(var i=0;i<document.form1.elements.length;i++) { if(document.form1.elements[i].name.indexOf("bb")!=-1) document.form1.elements[i].disabled=!document.form1.elements[i].disabled; } } </SCRIPT> <BODY><form name=form1> <INPUT TYPE="button" NAME="aa " value=cindy onclick=haha()> <INPUT TYPE="button" NAME="bb " value=guoguo> <INPUT TYPE="button" NAME="bb " value=guoguo> 39.文字移动 <marquee scrollamount=3 onmouseover=this.stop(); onmouseout=this.start();> 40.双击网页自动跑 <SCRIPT LANGUAGE="JavaScript"> var currentpos,timer; function initialize() { timer=setInterval("scrollwindow()",1); } function sc() { clearInterval(timer); } function scrollwindow() { currentpos=document.body.scrollTop; window.scroll(0,++currentpos); if (currentpos != document.body.scrollTop) sc(); } document.onmousedown=sc document.ondblclick=initialize </SCRIPT>// |