RK* - rikkertkoppes.com

thoughts

tags, elements, attributes, properties etc

For once and for all:

Element
An element is an HTML (or XML) building block, they are the whole thing and exist in DOM space. They consist of attributes and child elements and are described by a start tag, content and an end tag. Example <p class="lede">this is a p element</p>.
Attribute
An attribute is an extention to an element, it's the class="lede" part in the above example and are built up by a (attribute) name and (attribute) value.
Tag
An element is bounded by its opening and closing tags, so it's the <p class="lede"> and the </p> parts. So please stop talking about tags when you mean elements or attributes! A nice example is that you can omit both start and end tags for the html, head and body elements (in html), but the elements themselves are always present (in DOM space).
Properties
Properties only live in DOM space. Some attributes reappear as properties, but they are not a priori the same, think of the className property versus the class attribute. They do not appear in the source code.

Further reading

Additional resources (top 15)

Below is a list of additional resources that might contain extra information about the subject at hand. These are all sites linking to this one (i.e. backtracking).

  1. What are tags, attributes, properties - Google Search (3)

comment

no comment

Add comment
older articles

AdministrationAtom feed