Jquery WYSIWYG Contents Change

Created For: http://stackoverflow.com/questions/10543037/how-to-setup-the-jquery-wysiwyg-change-event

by bizamajig

HTML

<script src="http://akzhan.github.com/jwysiwyg/jquery.wysiwyg.js"></script>
<link rel="stylesheet" href="http://akzhan.github.com/jwysiwyg/jquery.wysiwyg.css">
<textarea id="wysiwyg" rows="5" cols="103"></textarea>

CSS

#wysiwyg {
    width: 500px;
    height: 300px;
}

JavaScript

$("#wysiwyg").wysiwyg();


$('#wysiwyg').wysiwyg('document').keypress(function(e) {
    e.preventDefault(); //This will cancel the keypress
    alert('Keypress in jwysiwyg editor detected!');
});