Cross-browser solution for basic event handling