Как имитировать событие onmouseover на javascript

jQuery style
 $("#test").mouseenter();
 $('#test').mouseleave();

Чистый js
var el = document.getElementById('test');
var ev = document.createEvent("MouseEvent");
ev.initMouseEvent(
                               "mouseover",
                               true /* bubble */, true /* cancelable */,
                               window, null,
                               0, 0, 0, 0, /* coordinates */
                               false, false, false, false, /* modifier keys */
                               0 /*left*/, null
                            );
el.dispatchEvent(ev);

var ev = document.createEvent("MouseEvent");
ev.initMouseEvent(
                               "mouseout",
                               true /* bubble */, true /* cancelable */,
                               window, null,
                               0, 0, 0, 0, /* coordinates */
                               false, false, false, false, /* modifier keys */
                               0 /*left*/, null
                            );
el.dispatchEvent(ev);