1、后退 前进
<input type="button" value="后退" onClick="(-1)">
<input type="button" value="前进" onClick="( 1 );return true;">
2、返回
<form><input type="button" value="返回上一步" onClick="history.back(-1)"></form>
3、查看源码
<input type="button" name="view" value="查看源码" onClick="window.location="view-source:" +window.location.href">
4、禁止查看源码
<body oncontextmenu="return false"></body>
5、刷新按钮一
<input type="button" value="后退" onClick="(-1)">
<input type="button" value="前进" onClick="( 1 );return true;">
2、返回
<form><input type="button" value="返回上一步" onClick="history.back(-1)"></form>
3、查看源码
<input type="button" name="view" value="查看源码" onClick="window.location="view-source:" +window.location.href">
4、禁止查看源码
<body oncontextmenu="return false"></body>
5、刷新按钮一
<input type="button" value="刷新按钮一" onClick="ReloadButton()">
<script>function ReloadButton(){location.href="i001.htm";}</script>
刷新按钮二
<input type="button" value="刷新按钮二" onClick="(0)">
6、回首页按钮
<input type="button" value="首页" onClick="HomeButton()">
<script>function HomeButton(){location.href=www.winliuxq;}</script>
7、弹出警告框
<input type="button" value="弹出警告框" onClick="AlertButton()">
<script>function AlertButton(){window.alert("要多多光临呀!");}</script>
8、状态栏信息
<script>function ReloadButton(){location.href="i001.htm";}</script>
刷新按钮二
<input type="button" value="刷新按钮二" onClick="(0)">
6、回首页按钮
<input type="button" value="首页" onClick="HomeButton()">
<script>function HomeButton(){location.href=www.winliuxq;}</script>
7、弹出警告框
<input type="button" value="弹出警告框" onClick="AlertButton()">
<script>function AlertButton(){window.alert("要多多光临呀!");}</script>
8、状态栏信息
<input type="button" value="状态栏信息" onClick="StatusButton()">
<script>function StatusButton(){window.status="要多多光临呀!";}</script>
9、背景变换
<form><input type="button" value="背景变换" onClick="BgButton()"></form>
<script>function BgButton(){
if (document.bgColor=='#00ffff')
{document.bgColor='#ffffff';}
else{document.bgColor='#00ffff';}
}
</script>
10、打开新窗口
<input type="button" value="打开新窗口" onClick="NewWindow()">
<script>function NewWindow(){window.open("c01.htm","","height=240,width=340,status=no,
<script>function StatusButton(){window.status="要多多光临呀!";}</script>
9、背景变换
<form><input type="button" value="背景变换" onClick="BgButton()"></form>
<script>function BgButton(){
if (document.bgColor=='#00ffff')
{document.bgColor='#ffffff';}
else{document.bgColor='#00ffff';}
}
</script>
10、打开新窗口
<input type="button" value="打开新窗口" onClick="NewWindow()">
<script>function NewWindow(){window.open("c01.htm","","height=240,width=340,status=no,
location=no,toolbar=no,directories=no,menubar=no");}
</script>
11、窗口最小化
<OBJECT id="min" type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"><PARAM name="Command" value="Minimize"></OBJECT><button onClick="min.Click()">窗口最小化</button>
12、全屏代码
<input type="BUTTON" name="FullScreen" value="全屏显示" onClick="window.open(document.location, 'butong_net', 'fullscreen')">
13、关闭窗口
<OBJECT id=closes type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"><param name="Command" value="Close"></object><input type="button"
</script>
11、窗口最小化
<OBJECT id="min" type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"><PARAM name="Command" value="Minimize"></OBJECT><button onClick="min.Click()">窗口最小化</button>
12、全屏代码
<input type="BUTTON" name="FullScreen" value="全屏显示" onClick="window.open(document.location, 'butong_net', 'fullscreen')">
13、关闭窗口
<OBJECT id=closes type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"><param name="Command" value="Close"></object><input type="button"
value="关闭窗口" onClick="closes.Click();">
关闭窗口
<input type=button value=关闭窗口 onClick="javascript:self.close()">
14、最大化
<object id=big classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">
<param name="Command" value="Maximize"></object><input type=button value=最大化 onClick=big.Click()>
15、关闭输入法
<input value=关闭输入法>
关闭窗口
<input type=button value=关闭窗口 onClick="javascript:self.close()">
14、最大化
<object id=big classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">
<param name="Command" value="Maximize"></object><input type=button value=最大化 onClick=big.Click()>
15、关闭输入法
<input value=关闭输入法>
16、链接按钮1
<input type="button" value="链接按钮1" onClick="window.open('www.winliuxq/', 'Sample', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resi
<input type="button" value="链接按钮1" onClick="window.open('www.winliuxq/', 'Sample', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resi
zable=yes,copyhistory=yes,width=790,height=520,left=0,top=0')" name="input">
链接按钮2
网页自动关闭<input type="BUTTON" NAME="Button" value="链接按钮2" onClick="showModalDialog('www.winliuxq/')">
链接按钮3
<input type="submit" value="链接按钮3" onClick="location.href='www.winliuxq/'">
17、警告框显示源代码
<BUTTON onClick=alert(document.documentElement.outerHTML) >警告框显示源代码</BUTTON>
18、点击后按钮清空
链接按钮2
网页自动关闭<input type="BUTTON" NAME="Button" value="链接按钮2" onClick="showModalDialog('www.winliuxq/')">
链接按钮3
<input type="submit" value="链接按钮3" onClick="location.href='www.winliuxq/'">
17、警告框显示源代码
<BUTTON onClick=alert(document.documentElement.outerHTML) >警告框显示源代码</BUTTON>
18、点击后按钮清空
<input type=button value='打印' onClick="this.style.visibility='hidden';window.print();">
19、打印
<input type=button value='打印' onClick="window.print();">
20、打印预览
<OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height=0 id=wb name=wb width=0></OBJECT>
<input type=button value=打印预览 onclick="wb.execwb(7,1)">
21、另存为
<input onClick="Command('saveas','true','常用代码.htm')" type=button value=另存为>
22、点击自动复制
19、打印
<input type=button value='打印' onClick="window.print();">
20、打印预览
<OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height=0 id=wb name=wb width=0></OBJECT>
<input type=button value=打印预览 onclick="wb.execwb(7,1)">
21、另存为
<input onClick="Command('saveas','true','常用代码.htm')" type=button value=另存为>
22、点击自动复制
<script>function oCopy(obj){obj.select();ateTextRange();js.execCommand("Copy")}</script>
<input type="text" value="点击自动复制" onClick="oCopy(this)" size="11">
23、自动选中
<input value="自动选中" onFocus="this.select()" onMouseOver="this.focus()" size="11">
24、打开源代码
<BUTTON onClick="document.location = 'view-source:' + document.location" size="7">打开源代码</BUTTON>
25、新窗口延迟打开
<input type=button value=新窗口延迟打开 onClick=javascript:setTimeout("window.open('www.winliuxq/')",10000)>
<input type="text" value="点击自动复制" onClick="oCopy(this)" size="11">
23、自动选中
<input value="自动选中" onFocus="this.select()" onMouseOver="this.focus()" size="11">
24、打开源代码
<BUTTON onClick="document.location = 'view-source:' + document.location" size="7">打开源代码</BUTTON>
25、新窗口延迟打开
<input type=button value=新窗口延迟打开 onClick=javascript:setTimeout("window.open('www.winliuxq/')",10000)>
26、实现选中文本框里的前一半的内容
<input type="text" value="选中文本框里的前一半的内容" size=30 onmouseover="this.select();tR=ateRange();tR.moveEnd('character',-8);tR.select();">
<input type="text" value="选中部分内容,非IE可以用这个" size=30 onmouseover="this.selectionStart=this.value.length-4;this.selectionEnd=this.value.length">
27、点击清空文字
<input type="text" name="artist" size=14 value="点击清空文字" onmouseover=this.focus() onfocus=this.select() onclick="if(this.value=='点击清空文字')this.value=''">
点击清空文字
<input name=name size=11 value=点击清空文字 onMouseOver=this.focus() onblur="if (this.value =='') this.value='点击清空文字'" onFocus=this.select() onClick="if (this.value=='点击清空文字') this.value=''">
<input type="text" value="选中文本框里的前一半的内容" size=30 onmouseover="this.select();tR=ateRange();tR.moveEnd('character',-8);tR.select();">
<input type="text" value="选中部分内容,非IE可以用这个" size=30 onmouseover="this.selectionStart=this.value.length-4;this.selectionEnd=this.value.length">
27、点击清空文字
<input type="text" name="artist" size=14 value="点击清空文字" onmouseover=this.focus() onfocus=this.select() onclick="if(this.value=='点击清空文字')this.value=''">
点击清空文字
<input name=name size=11 value=点击清空文字 onMouseOver=this.focus() onblur="if (this.value =='') this.value='点击清空文字'" onFocus=this.select() onClick="if (this.value=='点击清空文字') this.value=''">
28、等于标题(title):
<input type="text" value="" id="aa" size="20">
<script&ElementById("aa").value=document.title;</script>
29、检测IE是否脱机
<input type="button" value="测试" onclick="alert(Line)">
30、11种刷新按钮的方法
<input type=button value=刷新 onClick="(0)">
<input type=button value=刷新 onClick="load()">
<input type=button value=刷新 onClick="location=location">
<input type=button value=刷新 onClick="location.assign(location)">
<input type=button value=刷新 onClick="Command('Refresh')">
<input type=button value=刷新 onClick="window.navigate(location)">
<input type=button value=刷新 onClick="place(location)">
<input type=button value=刷新 onClick="window.open('自身的文件','_self')">
<input type=button value=刷新 onClick=document.all.WebBrowser.ExecWB(22,1)>
<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>
<form action="自身的文件"><input type=submit value=刷新></form>
<a id=a1 href="自身的文件"></a><input type=button value=刷新 onClick="a1.click()">
<input type=button value=刷新 onClick="window.open('自身的文件','_self')">
<input type=button value=刷新 onClick=document.all.WebBrowser.ExecWB(22,1)>
<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>
<form action="自身的文件"><input type=submit value=刷新></form>
<a id=a1 href="自身的文件"></a><input type=button value=刷新 onClick="a1.click()">
发布评论