Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between HTML tags and elements?

I notice that most people use the words HTML tags and HTML elements interchangeably.

But what is the difference between them?

The way I see it is that tags are in the source code and elements are processed tags (by the browser) in the DOM. Am I wrong?

like image 970
user Avatar asked Jan 20 '12 06:01

user


1 Answers

HTML tag is just opening or closing entity. For example:

<p> and </p> are called HTML tags

HTML element encompasses opening tag, closing tag, content (optional for content-less tags) Eg:

<p>This is the content</p> : This complete thing is called a HTML element

like image 144
Amol Chavan Avatar answered Oct 17 '22 15:10

Amol Chavan