On my page i have div tag:
Code:
<div id="panel"></div>
Could you explain me why I can't attach the event to the link with the folowing code:
Code:
var linkTemplate = new YAHOO.ext.DomHelper.Template('{0}');
linkTemplate.compile();
var elem = linkTemplate.overwrite('panel', ['link']);
var onClick = function(){alert();}
YAHOO.ext.EventManager.addListener(elem, 'click', onClick);
YAHOO.ext.Element.get('panel').dom.innerHTML += '';//dummy code, but it is needed in my real situation