PDA

View Full Version : NAME= and ID= finally trade places



weegillis
08-10-2011, 01:41 AM
There was a time long ago when fragment references were by name, as in a name=something. We will want to get out of that habit, as of right now. The NAME attribute (on a tags, and probably others) is not just deprecated, it's obsolete in HTML5. We simply cannot use it. The spec asks for ID on the object, or on the parent container.

The winner in this is not just ID, but TITLE as well. A stand alone <a> tag with title attribute only is still valid code. So we can still drop in hooks without creating links or special containers. We can't address the fragment, however, since it has no name or id. The key is that it responds to mouse over. <a id="something" title="blah blah blah"> is just a waste though. We can address fragments of all types since long ago and finally the TITLE attribute is getting its due recognition and browser support. <section title="fragment"> will render in all current version browsers.

We still have our secret hook in <a>, though. This is cool.