+ 4
What is the difference between element and attribute in html?
elements and attribute of html and html5
4 Answers
+ 14
Html elements are basically tags
And attributes are used for defining its characteristic or properties.
For eg
<img src="a.jpg" height="200px" width="200px">
Here
IMG is an element.
src, height, width are attributes. âșïž
+ 4
HTML-elements can contain attributes.
For example a div-element can contain the class attribute:
<div class="my-class"></div>
+ 3
element can contain attributes.
attributes used to give some effect or style to html element. for example, align="right"
0
Attributes modifies the thing it's talking about while elements are the defining of that property