I'm trying to acces into an bootstrap-wysihtml5 editor object. I'm doing this by this way:
$(document).ready(function () {
$('.someLink').live('click', function () {
var wysihtml5Editor = $('#textarea').wysihtml5().editor;
console.log('wysihtml5Editor: '+wysihtml5Editor);
wysihtml5Editor.composer.commands.exec("bold");
});
});
Chrome console returns:
> wysihtml5Editor: undefined
> Uncaught TypeError: Cannot read property 'composer' of undefined
So, the point is.
Which is the way to acces into an wysihtml5 object?
The point of everything is insert some html code into my textarea.