JavaScript Editor

Invoke the destroy method of the jqxEditor. Author: http://jqwidgets.com

by mark edwards

HTML

<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.base.css">
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.energyblue.css">
<script src="http://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<br /><br /><br /><br /><br />
<div id="editor" contenteditable=true> <strong>Editor Value</strong>

</div>
<br/><br/>
<button id='destroyButton'>Destroy</button>
<button id='trueButton'>ture</button>
<button id='falseButton'>false</button>

JavaScript

$('#editor').jqxEditor({
    height: 400,
    width: 800,
    theme: 'energyblue'
});

$("#destroyButton").jqxButton({
    theme: 'energyblue'
});

$("#trueButton").click(function () {
   console.log('AAAA')
   console.log($('#editor').attr('contenteditable'));
   console.log('BBBB')
   $('#editor').attr('contenteditable', true)
})
$("#falseButton").click(function () {
   console.log($('#editor').attr('contenteditable'))
   $('#editor').attr('contenteditable', false)
})

 
$("#destroyButton").click(function () {
    $('#editor').attr('contenteditable', false)
    $('#editor').jqxEditor('destroy');
});