Javascript examples for DOM Event:onclick
Adding an onclick event to a text without breaking the line
<html> <head></head> <body> <p> See our // w w w . jav a 2 s .co m <span onclick="openWindow()" style="cursor: pointer; color:blue">test page</span> and other sad things... </p> <script> function openWindow() { window.open("https://www.java2s.com"); } </script> </body> </html>