What's New with HTML 5: Global Attributes

By Curtis Dicken

http://www.htmlgoodies.com/html5/tutorials/Whats-New-with-HTML-5-Global-Attributes-3875431.htm (Back to article)

Introduction to HTML 5

In the new world of HTML 5 some things will remain the same, some will go away and many will be added. In this article we will take a look specifically at what's new with the global (sometimes called standard) attributes. Global attributes are those attributes that apply to all HTML elements.

About HTML 5 Attributes

For those new to HTML, attributes are the parts of HTML elements that define them. Attributes provide additional information that a browser can use to determine things like how to display an element. Attributes are also responsible for providing details that a developer can use when creating scripts, such as the id attribute which allows the developer to find a specific element to manipulate using a scripting language like JavaScript.

Global attributes in HTML 4 were designed to be universally applied to all HTML elements. That meant that every HTML element had an id attribute, a lang attribute, a class attribute and so on. With HTML 5 there are really few new truly global attributes. Instead you will find new mostly global attributes that apply to many but not all elements.

Some Things Remain the Same

The genuinely global attributes from HTML 4 included in HTML 5 are the same in both versions of HTML. So, I'm going to just run down the list with a brief explanation of each for readers that are new to HTML:

But Many Things are New

The global attributes of HTML 4 were fairly easy and straight-forward in their naming and function. With HTML 5 it's not as easy to infer the function of an attribute from its name. That coupled with the fact that “global” has been downgraded mostly global makes some attributes even more confusing.

Conclusion

The new additions to the global attributes in HTML 5 are just a tip of the iceberg. Some attributes will likely be rapidly adopted like data and draggable while others are hard to envision widespread use like item and itemprop.

Don't get too excited or nervous yet, though. Implementation of the new HTML 5 standards is a slow and inconsistent process. While some browsers like Firefox and Safari are making steady progress in implementing HTML 5, others like Internet Explorer are lagging behind the pack. What that simply means for developers using HTML 5 is that consistent browser rendering of HTML 5 is just not quite there yet but well on its way.