elect1'')" type=button value=全选并复制><BR><TEXTAREA name=select1 rows=3 cols=46>你好,欢迎您的光临!</TEXTAREA>
</FORM>
<SCRIPT language=Javascript>
<!--
var copytoclip=1
function HighlightAll(theField) {
var tempval=eval("document."+theField)
tempval.focus()
tempval.select()
if (document.all&©toclip==1){
therange=tempval.createTextRange()
therange.execCommand("Copy")
window.status="Contents highlighted and copied to clipboard!"
setTimeout("window.status=''''",1800)
}
}
//-->
</SCRIPT>
屏蔽JAVASCRIPT错误
<script language="JavaScript">
<!--
function killErrors(){
return true;
}
window.onerror = killErrors;
-->
</script>
关闭子窗口时刷新父窗口
<script language="JavaScript">
<!--
self.opener.location.reload();
window.close()
-->
</script>
背景色变换
<form>
<p><input TYPE="button" VALUE="背景色变换" onClick="BgButton()"></p>
</form>
<script>function BgButton(){
if (document.bgColor==''#00ffff'')
{document.bgColor=''#ffffff'';}
else{document.bgColor=''#00ffff'';}
}
</script>
检查一段字符串是否全由数字组成
<script language="Javascript"><!--
function checkNum(str){return str.match(//D/)==null}
alert(checkNum("1232142141"))
alert(checkNum("123214214a1"))
// --></script>