Code
Execute
<!DOCTYPE html> <html> <head> <title>Wikitechy onclick attribute</title> </head> <body> <p onclick="onClick()">Click Here!</p> <script> function onClick() { alert('Welcome to Wikitechy!'); } </script> </body> </html>
Result