I'd like to add SimpleMDE to 6 textareas in a page.
What is the best way?
My idea is:
var simplemde = new SimpleMDE({ element: $(".simplemde")[0,1,2,3,4,5] });
Will this work or any better way to do it?
Ok, I found the solution in another thread.
$('textarea').each(function() {
var simplemde = new SimpleMDE({
element: this,
});
simplemde.render();
})
Thank you!
i correct this, for the new version
JQuery
$('textarea').each(element => {
const simplemde = new SimpleMDE({
element: element,
});
});
Js
[].forEach.call(document.getElementsByTagName('textarea'),element => {
const simplemde = new SimpleMDE({
element: element,
});
});
The simplemde.render(); is not needed
Most helpful comment
Ok, I found the solution in another thread.
Thank you!