CKEditor
by XcsN
HTML
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.ckeditor.com/4.4.7/standard/ckeditor.js"></script>
<textarea name="editor1">
</textarea>
<br />
<textarea id="final" style="width: 100%; height: 125px;"></textarea>
<br />
<button id="btn1">
Get Value
</button>
JavaScript
CKEDITOR.replace('editor1', {
allowedContent: true,
on: {
instanceReady: function() {
this.dataProcessor.htmlFilter.addRules( {
elements: {
ul: function( el ) {
if ( !el.attributes.style) {
el.attributes['style'] = 'list-style: square';
}
},
li: function( el ) {
if ( !el.attributes.style) {
el.attributes['style'] = 'color: red';
}
}
}
} );
}
}
});
$('#btn1').on('click', function() {
$('#final').val(CKEDITOR.instances.editor1.getData());
});