Yes you can, but a funny little change you need to make is to change .live to .on. here is a link to a discussion of the significance of this small change.
$(document).ready(function(){ $('#editor').summernote({ height:200, toolbar: [ ['text', ['bold', 'italic', 'underline']], ['misc', ['codeview']] ] }); $('[data-event="codeview"]').on('click', function(){ $('#editor').code($('#editor').code()+'a'); }); $('#btn').click(function(){ $('#editor').code($('#editor').code()+'a'); }); });
and you can visit the working script http://jsfiddle.net/2tnua16k/
source share