Javascript examples for DOM Event:onclick
Pass this element and custom value to event handler
<!DOCTYPE html> <html> <body> <p onclick="myFunction(this, 'red')">Click me to change my text color.</p> <script> function myFunction(elmnt,clr) {//from w w w . j a v a2 s . co m elmnt.style.color = clr; } </script> </body> </html>