<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>custom_event</title>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
</head>
<body>
<div>
<input id="but01" type="button" value="кнопка"/>
</div>
<script type="text/javascript">
function handler() { alert("работает!"); }
var privatEvent;
if (document.createEvent) {
privatEvent = document.createEvent("MouseEvents");
privatEvent.initEvent("customEvent", true, false);
} else if (document.createEventObject) {
privatEvent = document.createEventObject();
}
var getBut = document.getElementById("but01");
if (document.addEventListener) getBut.addEventListener("customEvent", handler, true);
else if (document.attachEvent) getBut.attachEvent("oncustomEvent", handler);
if (document.dispatchEvent) getBut.dispatchEvent(privatEvent);
else if (document.fireEvent) getBut.fireEvent("oncustomEvent", privatEvent);
</script>
</body>
</html>
Если заменить "customEvent"" на, например, "click", то всё работает (это я про IE).