tiff / wysihtml5

Open source rich text editor based on HTML5 and the progressive-enhancement approach. Uses a sophisticated security concept and aims to generate fully valid HTML5 markup by preventing unmaintainable tag soups and inline styles.
http://xing.github.com/wysihtml5/
MIT License
6.49k stars 995 forks source link

access editor with class name not with id attribute? #481

Open gorakrao opened 10 years ago

gorakrao commented 10 years ago

can't we assign class instead of id for textarea

Waxolunist commented 10 years ago

Should be possible, at least in my repo it is possible. See here http://waxolunist.github.io/bootstrap3-wysihtml5-bower/

kasperisager commented 10 years ago

Simply passing in a DOM node will do the trick:

// HTML5
var textarea = document.querySelector('.class');

// jQuery
var textarea = $('.class').get();

// And finally...
var editor = new wysihtml5.Editor(textarea, { ... });