0

I can easily wrap a text selection with span tag through a button click like this;

this.toolbar.on( 
    'testClick', 
    function(o) 
    {
        var sel = myEditor._getSelection();
        myEditor.execCommand('inserthtml', '<span class="test">' + sel + '</span>');
        alert(myEditor);
    }, 
    myEditor, true);

What I am trying to achive is to bind this span class ('test') within the iframe to a javascript event;

testEvent = function {
    alert('Hello World!')
}

Any ideas if that's possible?

Rushen Bilgin
  • 51
  • 1
  • 4

1 Answers1

0

Answering my own question.

var sel = myEditor._getSelection();

YAHOO.util.Event.addListener( sel, 'click', anyMethod, anyContext );

function anyMethod( e, anyContext )
{
   alert(clicked);
}
Rushen Bilgin
  • 51
  • 1
  • 4