Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the Document</title> </head> <body> <input type="button" id="button" value="Button"> <script> function welcome() { alert('Welcome') } button.onclick = function() { welcome(); // the attribute content } </script> </body> </html>