scottysseus
scottysseus

Reputation: 2020

HTML: element breakdown

Suppose I have the following HTML element:

<foo spam="eggs">bar</foo>

I know that foo is the 'tag', but what are the technical names for spam, eggs, and bar?

Upvotes: 0

Views: 619

Answers (3)

Mike Mayday
Mike Mayday

Reputation: 15

I recommend this one and the next chapter: http://www.w3schools.com/html/html_elements.asp In any case, these are called attributes, values and content. EDIT: whoa, ninjas abound.

Upvotes: 1

allicarn
allicarn

Reputation: 2919

spam is an attribute name "eggs" is the attribute spam's value and bar is a child node, in this case, a child of type textNode. Children can also be "elements" (aka tags).

Read more on elements (aka tags) here: http://www.w3schools.com/html/html_elements.asp

And on attributes here: http://www.w3schools.com/html/html_attributes.asp

Upvotes: 1

Patryk W.
Patryk W.

Reputation: 82

spam="eggs" is attribute (as a whole) and bar is the child node.
You can also break the attribute down to attribute name and attribute value.

Upvotes: 1

Related Questions