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

jquery keypress,keyup,onpropertychange keyboard event_jquery

WBOY
Release: 2016-05-16 18:24:33
Original
1143 people have browsed it

At first, I used the onkeyup event of js, but it was never triggered. I don’t know where else the event is monitored. The js event can be delivered and blocked. It’s quite troublesome and there are too many situations. After searching for a long time, I finally found a solution, which can be solved through the onpropertychange event.

Copy code The code is as follows:

$("#textboxID").bind("onpropertychange ", function(){
//alert( $(this).text() );
//Automatically intercepted logic code
});

firefox does not onpropertychange
The following is a code that is easier to use and has better compatibility
Copy the code The code is as follows:

jQuery("#txtContent").keypress(function() {
}).keyup(function() {
});
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