I am looking for a simple example to save content from a contentEditable div without using php. I can't use php because I am using it in Google Docs. I would prefer an example with innerHTML.
1 Answer
If you don't want to use PHP or any Server Side Script then you can use only cookies or localStorage like
$('div.contentEditable').on('keyup',function(){
localStorage.setItem('content',$(this).html());
});
And get the localstorage item like,
localStorage.getItem('content');// if content is previously set
And if you can use Server side script then use $.ajax() to store it in database and use it.
code, in yourPOSThere is your code