1

If for example, I have a tag: <a href="#">Ex1</a>, I want to identify what that tag is doing there. Title,class & id attributes aren't options as I use class&id for CSS and title displays text when hovered. So, is there any attribute to do that? Thanks!

4

3 回答 3

4

Not really sure what your asking, but are you trying to apply meta-data as an attribute? If so, you can add more than one class (class="one two three fourClasses"), or use the data- attribute.

于 2012-06-06T15:19:00.220 回答
2

You can also use "data-[yourText]" as a cross-browser-safe attribute in any elements, and this often makes it nice to describe things because you can include more information in the custom data attribute value:

<a href="#" data-example="1">Ex1</a>
<a href="#" data-example="2">Ex2</a>
<a href="#" data-example="3">Ex3</a>
于 2012-06-06T15:20:14.123 回答
0

What's wrong with <!-- HTML comments --> for annotations?

于 2012-06-06T15:17:50.687 回答