Msg#: 4598300 posted 2:58 am on Aug 2, 2013 (gmt 0)
The short version of the docs is:
This is an HTML element <p> [change p to any valid tag and it's still an element]
This is an element with an HTML attribute <p class="some_class"> [change class="some_class" to anything else valid for the element being used or add another attribute="value" and those are it's attribute(s)]
Msg#: 4598300 posted 3:38 pm on Aug 2, 2013 (gmt 0)
To nitpick. Some browsers have been known to have issues with attribute[space]=[space]"value". It doesn't happen very often any more; I've only seen it a handful of times recently with empty attributes (i.e. checked vs checked="checked"). In other words -- it's best to not use spaces around the equal sign (=) separating the attribute from its value. Makes HTML parsing or regular expressions much easier as well. I know that HTML5 explicitly allows space characters (which, IMO is a bad move), but I still recommend against it.
Msg#: 4598300 posted 6:34 pm on Aug 2, 2013 (gmt 0)
To nitpick. <p> is a tag that represents an element.
Okay, okay, okay -- How about 'Any valid tag is often loosely referred to as an element, even if the tag is not technically an element itself, while an attribute appears within a tag as attribute="value".'? (lol)