New to Kendo UI for jQuery? Download free 30-day trial

Handle Blur and Focus Events in the Editor

Environment

Product Progress® Kendo UI® Editor for jQuery
Operating System Windows 10 64bit
Visual Studio Version Visual Studio 2017
Preferred Language JavaScript

Description

How can I handle focus and blur events in the Kendo UI for jQuery Editor?

Solution

The Editor does not expose focus and blur events as built-in functionalities.

However, regardless of the initialization mode you apply to the widget, you can handle them by using JavaScript.

The following example demonstrates how to handle the blur and the focus events of the Editor.

    <style>
      #editor{
        position: absolute;
        width: 90%;
        top: 60px;
      }
    </style>
    <body>
      <textarea id="editor"></textarea>
      <script>
        var editor = $('#editor').kendoEditor().data('kendoEditor');
        $(editor.body).focus(function(){
          console.log('Focus');
        }).blur(function(){
          console.log('Blur')
        });
      </script>

See Also

In this article