Handling Events via HTML Attributes
<!DOCTYPE html> <html lang="en"> <head> <title>Connecting Events Using HTML Attributes</title> </head> /* ww w .j a va 2 s .c o m*/ <body> <a href="somepage.html" onclick="return linkClick()">Click Me</a> <script> function linkClick() { console.log("You Clicked?"); return true; } </script> </body> </html>