Created
February 7, 2014 13:18
-
-
Save jtyjty99999/8862498 to your computer and use it in GitHub Desktop.
测试输入法事件composition
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <input type="text" name="" id="hello"> | |
| <script> | |
| var h = document.getElementById('hello'); | |
| h.addEventListener("compositionstart", onCompositionStart,false); | |
| h.addEventListener("compositionupdate", onCompositionUpdate,false); | |
| h.addEventListener("compositionend", onCompositionEnd,false); | |
| function onCompositionStart(){ | |
| console.log(1) | |
| } | |
| function onCompositionUpdate(){ | |
| console.log(2) | |
| } | |
| function onCompositionEnd(){ | |
| console.log(3) | |
| } | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment