Reputation: 1739
I am creating some HTML fragements, the fragements will be wrapped in a DIV tag - ie its parent.
I do not have access to the DIV parent tag.
The fragment could be anything.
I want to be able to distinguish between different fragments. My idea was to insert a html element as metadata as the first element in the fragement.
The parent div can then identify what type it is by searching its first child for the meta information.
ie
<div class="parent">
<metatag fragement="fragementid"/>
<p>...</p>
<p>...</p>
</div>
My question is, is there a HTML tag for this purpose?
Upvotes: 1
Views: 1022
Reputation:
Go through: http://www.w3.org/tr/html401/struct/global.html for better understanding on HTML structure.
Still you can add meta information to your tags by using an additional hidden tag.
Example:
http://jsfiddle.net/w49g19bw/
<p data-meta="HN SPECS" class="hidden"></p>
.hidden {
display:none;
}
Upvotes: 3