Home > Web Front-end > JS Tutorial > body text

JavaScript Enter focus switch_javascript skills

WBOY
Release: 2016-05-16 18:51:47
Original
1226 people have browsed it
Copy code The code is as follows:



If multiple keyboard listening events are registered, even if the keyCode value is modified in the code segment, other keyboard listening events will still obtain the original keyCode. This is related to the JavaScript event model (remember to start from each registered listening event and propagate the event along its own route).
The following is the test code:

Key code:
[Ctrl A select all Note: <script> $(function(){ $(document).keydown(function(evt){ debug(evt); }); }); </script>If you need to introduce external Js, you need to refresh to execute ]<script> function debug(evt){ document.getElementById('info').innerText=evt.keyCode||evt.charCode; } </script>
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!