Skip to content

Instantly share code, notes, and snippets.

@CarterTsai
Created November 24, 2013 16:56
Show Gist options
  • Save CarterTsai/7629395 to your computer and use it in GitHub Desktop.
Save CarterTsai/7629395 to your computer and use it in GitHub Desktop.
A Pen by CarterTsai.

IME Event Handle

When using an Input method editor (IME) to input text. The event will be fired

A Pen by CarterTsai on CodePen.

License.

<input class="myInput"
type="text"
placeholder="Starts using an Input method editor (IME) to input text"/>
var text = document.querySelector(".myInput");
console.dir(text);
text.addEventListener("compositionstart", function(){
alert("IME Start ");
});
text.addEventListener("compositionend", function(){
alert("IME End");
});
input {
width: 400px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment