87,921
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="http://lib.sinaapp.com/js/jquery/1.7.2/jquery.min.js"></script>
<script>
$(function(){
$('#print').bind('click',function(){
console.log("start")
e = jQuery.Event("keydown");
e.keyCode= 112; //enter key
e.ctrlKey=true;
e.shiftKey=true;
$(document).trigger(e);
console.log("end")
})
$(document).keydown(function(e){
console.log(e.keyCode)
console.log(e.ctrlKey)
console.log(e.shiftKey)
})
})
</script>
</head>
<body>
<button id="print">狠戳chrome打印</button>
<input type="text" id="t">
</body>
</html>