Try
$(document).ready(function(){
$("#run").click(function(){
$('#drawing').html(editor.doc.getValue());
});
});
And it's not a great idea to start putting extra html
and body
tags and such in that div. Consider using an iframe instead.