What is your opinion about using non valid attributes on html elements for easier jQuery selectors etc ?
Eg.
<div name="开发者_StackOverflow中文版myDiv"></div>
According to Visual Studio the name attribute is not valid for a div element.
I would recommend using "dummy" classes (and the jQuery class selector) to disambiguate naming of html elements. 100% compliant approach.
Class Selector (“.class”)
If you absolutely must, use the data pseudo-namespace; such as data-id or data-name.
Edit: Using the data pseudo-namespace is far better than perverting the usage of an existing attribute like class or id.
If you still wanted to remain w3c compliant, the w3c allows title attribute for extra information, which you can use in lieu of adding new non-standard attributes.
加载中,请稍侯......
精彩评论