Trying to create Share-Wysiwyg

I am stuck as to how I should attack this problem. I am trying to create a Wysiwyg Editor that works with ShareJS. The demo can be found here:

http://173.230.158.248:10000/Tiny.html

I am trying to create a light weight near realtime wysiwyg editor that anyone can incorporate to their site easily. The problem that I am encountering is that I can update the div area and copy the html contents of the div to the textarea. I am unable to trigger the textarea function here:

https://github.com/jcostello84/sharejs-wysiwyg/blob/master/Tiny_files/textarea2.js#L81

I've tried using using a trigger like:

$('#purpose-editor').trigger('keydown');

However it returns:

Uncaught TypeError: Object asdfads<div>asdf</div> has no method 'attachEvent'

Does anyone have an idea how I can trigger the keydown event on the textarea when updating the div?