今天给大家带来js怎么发送组合键,实现打印复制粘贴查找等功能,js发送组合键的方法,实现打印复制粘贴查找等功能,让您轻松解决问题。
下面方法适用于ie浏览器具体方法如下:
1<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>Document</title>
</head>
<body>
1111111111111111111111111111111111
<INPUT/>
<input type="button" onclick="dayin()" value="点击我打印"/>
<input type="button" onclick="fuzhi()" value="点击复制"/>
<input type="button" onclick="zhantie()" value="点我粘贴"/>
<input type="button" onclick="chazhao()" value="点我查找"/>
<input type="button" onclick="guanbi()" value="点我关闭"/>
</body>
<script>
function dayin(){
var wsShell = new ActiveXObject("WScript.Shell");
wsShell.SendKeys("^(p)");
}
function fuzhi(){
var wsShell = new ActiveXObject("WScript.Shell");
wsShell.SendKeys("^(c)");
}
function zhantie(){
var wsShell = new ActiveXObject("WScript.Shell");
wsShell.SendKeys("^(v)");
}
function chazhao(){
var wsShell = new ActiveXObject("WScript.Shell");
wsShell.SendKeys("^(f)");
}
function guanbi(){
var wsShell = new ActiveXObject("WScript.Shell");
wsShell.SendKeys("%({F4})");
}
</script>
</html>
以上就是js怎么发送组合键,实现打印复制粘贴查找等功能,js发送组合键的方法,实现打印复制粘贴查找等功能教程,希望本文中能帮您解决问题。
电脑软件相关教程