http://help.dottoro.com/ljbwbehw.php

来源:互联网 发布:tensorflow cuda 编辑:程序博客网 时间:2024/06/05 11:58
<head>    <script type="text/javascript">        function InsertChar () {            try {                var pressEvent = document.createEvent ("KeyboardEvent");                pressEvent.initKeyEvent ("keypress", true, true, window,                                         false, false, false, false,                                         0, "x".charCodeAt (0));                var input = document.getElementById ("myInput");                input.dispatchEvent (pressEvent);            }            catch (e) {                alert ("Your browser does not support this example!");            }        }    </script></head><body>    <input type="text" id="myInput" value="Input field" size="20"/>    <button onclick="InsertChar ()">Simulate pressing the 'x' key on the input.</button></body>


http://write.blog.csdn.net/postedit

原创粉丝点击