Javascript examples for DOM:Document addEventListener
Document addEventListener() Method - Click to Change the background color of the document's <body> element:
<!DOCTYPE html> <html> <body> <script> document.addEventListener("click", function(){ document.body.style.backgroundColor = "red"; });/*www .ja v a2s . c o m*/ </script> </body> </html>