But keep in mind that addEventListener
is supported in IE just from version 9. To support older versions of IE you could use something like that:
if (element1.addEventListener) { // all browsers except IE before version 9
element1.addEventListener("click", CalCal, false);
} else {
if (element1.attachEvent) { // IE before version 9
element1.attachEvent("click", CalCal);
}
}