demarcate.js lets you edit directly in a page and generate Markdown back from the HTML elements. It supports most browsers including mobile browser. As of version 2.0.0 there are no required dependencies. You may wish to include keymaster.js for key bindings and showdown.js if you want to put the Markdown back into HTML.
demarcate.js is under development by William Hart. It supports most of the basic Markdown tags. The library is offered under the MIT license
After you have looked at the github README, have a look at the following links to see how demarcate.js works:
I'm keen to hear any feedback, queries or issues. Get in touch via twitter - Tweet to @wlhart - or raise an issue / pull request on the github site.