今天給大家帶來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發送組合鍵的方法,實現打印複製粘貼查找等功能教程,希望本文中能幫您解決問題。
電腦軟件相關教程