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

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?



Solution 1:[1]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 jluims