How to get WMD editor value?

I play using the WMD editor ( http://wmd-editor.com/ ) on my site. I have a very simple question. When I am ready to send text to the server; How to get the result of the editor?

Something like this returns only "the actual text that the user entered into the text box"

    var jtext = document.getElementById('myTextarea').value;

I would like to get an "exit" from the editor; but I can not figure out how to do this :(

Conclusion; I mean the output of "Markdown" or "Html".

+3
source share
2 answers

javascript . wmd, div wmd-preview. , .

jQuery - :

$('#formname').submit(function() {
    $('#hidden_form_element').val($('.wmd-preview').html());
    return true;
});
+4

, id = "wmd-output",

0

Source: https://habr.com/ru/post/1704660/


All Articles