demo2

HTML DOM Events

The onclick Event

The onclick event triggers a function when an element is clicked on.

Click to trigger a function that will output "Hello World":

var codeBlock ='
'
+
'

This is a paragraph of text.

' + '
' ;































































The onclick Event

No comments

darkmode