I need to add to some divs in my tinyMCE content text "here you can add prepared blocks" so user can select this text and click button to replace content with prepared html.
I am having trouble accessing elements within tinyMCE iframe.
I am trying basic stuff first, but it does not work:
$("iframe").on('click', 'div', function(e) {
e.preventDefault();
alert('clicked');
});
I have found some solutions that I could access source textarea (and the work good), but what I need is DOM Tree within iframe so I could easily select the divs I need.