Comment limiter les caractères dans Div contenu

<div onkeypress="return (this.innerText.length <= 0)" contenteditable="true"> 
  
<!-- Allows user to only input one character in the div
	 Change the this.innerText.length <= 0 value to change the limit of characters.
 -->
ayaan