- mousedown
- mouseup
- click
- dblclick
- mousemove
- mouseover
- mouseout
Press → key to advance. Zoom in/out: Ctrl or Command + +/-.
Archaic method (really bad example)
var snippet = document.getElementById('codeexample'); snippet.onmouseover = pink; snippet.onmouseout = notpink; function pink(){ snippet.style.backgroundColor = '#f06'; } function notpink(){ snippet.style.backgroundColor = ''; }
myNode.addEventListener(type, listener, !bubble?);
for(var i = 0; i < lis.length ; i++){ lis[i].addEventListener("click", calledFunction); } function calledFunction(e){ /*do something*/ }
var namespace = { promos: ['val1', 'val2', 'val3'], setUpButtons: function(){ var listItems = document.querySelectorAll('#changeme li'); for(var i = 0; i < listItems.length; i++) { listItems[i].addEventListener("click", namespace.showClasses, true); } }, showClasses: function(e) { currentClass = this.getAttribute('class'); if(currentClass) { this.innerHTML += ' class="' + currentClass + '"'; } }, init: function(){ namespace.setUpButtons(); } } namespace.init();
jQuery with Doris Next!