I have problem with this code:
var xButton = document.createElement("a");
xButton.className = "cXButton";
xButton.href = "#";
xButton.onclick = "closePanel()";
xButton.innerHTML = "X";
While "closePanel()" is a function I already wrote. I used Firebug and found out that "onclick" attribute doesn't appear in a tag. I saw some threads where instead of the name of the function there is it's implementation (function closePanel(){...}). This is not what I'm looking for.
Any suggestions how to solve it?