var btn = document.getElementById ("btn");
if (btn.addEventListener) {// Compatible with IE9 and above, Chrome, Safari, Opera, Firefox
btn.addEventListener ("click", dome);
} else if (btn.attachEvent ) {// Compatible with IE8
btn.attachEvent ("onlick", dome);
} else {// Compatible with
btn.onclick = dome ();
};
function dome; () {
// Event body
alert ("Event binding succeeded!");
}