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:
[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>
Statement: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