Finding HTML Elements by Id

This example demonstrates the getElementsById method.

Finding HTML Elements by Tag Name.

This example demonstrates the getElementsByTagName method.

Finding HTML Elements by Tag Name

This example demonstrates the getElementsByTagName method.

First name:
Last name:

Hello World!

Name:

My Heading 1

Mouse Over Me

JavaScript addEventListener()

Bubbling:

Click me!


Capturing:

Click me!

My First Page

This is a paragraph.

This is another paragraph.

JavaScript HTML DOM

Replace an HTML Element.

This is a paragraph.

This is a paragraph.

\

JavaScript HTML DOM

Hello World!

Hello Norway!

Click the button to change the color of all p elements.

JavaScript HTML DOM

Hello World!

Hello Norway!