Is the name of an HTML element the same as its opening tag?

Viewed 14

For example < p> is a tag, < p>hello world...< /p> is an element. But on some sites the tag name is referred to as the element name as well. So the name of an element is given by its tag?

1 Answers

You could be referring to two things. The name of the tag:

For example, in this case

<p>Hello, World</p>

the name of the tag is "p"

or you could be talking about the name attribute

<p name="hi">Hello, World</p>

which would, in this case, be "hi".

So yes, the name of an element is given by its tag.

Related