javascript - Contenteditable attribute -


how can configure maximum number of rows in contenteditable attribute? want stop use after reach capacity of characters send in post method.

i'm using html 5. it's new atributte, can google it. it's value can true or false. contenteditable not using windows enccoded new lines like: \r\n, using creating divs , adding <br> tags it.

you run javascript on element, so:

function check_len(){     //disable editing, or here     if (element.innerhtml.length >= post_limit)         alert('you have reached post limit'); } 

and attach keyup handler

element.addeventlistener('keyup',check_len,false); 

Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -