Using more compatible document.createEvent