.preventDefault() not working in on.('input', function{})
问题 I would like to limit number of chars in my editable div to 10. After user reach the limit I would like to use .preventDefault() method to protect the div from additional chars. Can You help me out, please? JSFiddle https://jsfiddle.net/7x2dfgx6/1/ HTML <div class="profileInfo" id="About" style="border:solid;" contenteditable="true">OOOOO</div> JQuery jQuery(document).ready(function($){ const limit = 10; rem = limit - $('#About').text().length; $("#counter").append("You have <strong>" + rem +