CSS event:Selectors

Justin Palmer has created a wonderful JavaScript snippet named CSS event:Selectors that allows you to allow you access to Javascript events using a CSS style syntax. If you work at all with JavaScript you’ll probably love this little hack as much as I do.

Here is a quick example of what Palmer is up to:

 var Rules = { '#icons a:mouseover': function(element) { element.style.display = "none"; }, '#icons a:mouseout': function(element) { element.style.display = "block"; } } 

Pretty sweet! Â The article is very short and explains everything you need to know to implement event:SelectorsÂ with applicable code snippets as well, and includes links to view examples, documentation and to downloadÂ event:Selectors.