Edit this page

keyup

Fires when the user releases a keyboard key.

Example - subscribe to the "keyup" event during initialization

<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
  keyup: function(e) {
    console.log("keyup : keyCode=",e.keyCode);
  }
});
</script>

Example - subscribe to the "keyup" event after initialization

<textarea id="editor"></textarea>
<script>
function editor_keyup(e) {
  console.log("keyup : keyCode=",e.keyCode);
}
$("#editor").kendoEditor();
var editor = $("#editor").data("kendoEditor");
editor.bind("keyup", editor_keyup);
</script>

Example - show word count

<textarea id="editor"></textarea>
<div id="words"></div>
<script>
function wordCount(value) {
  return $.trim(value.replace(/<.*?>/g, " "))
    .replace(/['";:,.?\-!]+/g, '')
    .match(/\S+/g).length;
}

$("#editor").kendoEditor({
  keyup: function(e) {
    $("#words").text(wordCount(this.value()) + " words");
  }
});
</script>
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy