Can I add custom attribute to HTML tag like this: <tag myAttri="myVal" />
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
- implementing html5 drag and drop photos with knock
-
Why does the box-shadow property not apply to a
You can add, but then you have to write a line of javascript too:
to make sure everything fall in place. I mean IE :)
You can do it in a native way with JavaScript:
You can amend your !DOCTYPE declaration (i.e. DTD) to allow it, so that the [XML] document will still be valid:
#IMPLIED
means it is an optional attribue, or you could use#REQUIRED
, etc.more info here:
http://www.w3schools.com/xml/xml_dtd_attributes.asp
No, this will break validation.
In HTML 5 you can/will be able to add custom attributes. Something like this:
Another approach, which is clean and will keep the document valid, is to concatenate the data you want into another tag e.g. id, then use split to take what you want when you want it.