I managed to get the #content field html with this jquery call:
This seems to be failing though on "Add New Post" pages. Any tips on how to get the contents of the #content div?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.Sign up to join this community
#editorcontainer contains a regular textarea
#content and an iframe
#content is filled with the saved contents of the post when the page loads. This means that any live edits of the content won't be returned when calling
jQuery("#content").html(). For the same reason, you get an empty string in the case of a new post.
Where you really need to look for the live updated contents is in the iframe, which is used by the WYSIWYG editor. Here's how: