Jan 9, 2009 · In HTML5, yes. You just have to prefix them with data- . See the spec. Of course, this implies you should be using the HTML5 doctype ( <!doctype ...
People also ask
Can you make up HTML attributes?
If you want to define your own custom attributes in HTML, you can implement them through the data-* format. * can be replaced by any of your names to specify specific data to an element and target it in CSS, JavaScript, or jQuery.
How to create attribute in HTML?

The syntax for adding attributes to an HTML element is as follows:

1
<tagname attribute="value"></tagname>
2
<img src="source_of_image.png" width="500" height="600" />
3
<button disabled>Submit</button>
What are the rules for attributes in HTML?
The HTML standard does not require lowercase attribute names. The title attribute (and all other attributes) can be written with uppercase or lowercase like title or TITLE. However, W3C recommends lowercase attributes in HTML, and demands lowercase attributes for stricter document types like XHTML.
How do you add data attributes to a tag in HTML?
Adding a data attribute is easy. Any HTML element can have any number of data attributes added to its opening tag. We simply type data- followed by the name of our attribute into the element's opening tag alongside any other attributes we're already using.
Oct 19, 2010 · In xhtml, you definitely can't add attributes, since it would break the document definition and won't validate. However (as stated in the ...
Missing: 427262/ | Show results with:427262/
Jan 20, 2014 · I have been playing around with custom html attributes, for item-id's and things like that, and using it to make my code more readable (for me).
Missing: 427262/ | Show results with:427262/
May 13, 2010 · Add custom attribute to HTML tags · 1. How are you trying to access the attribute? · 1. You aren't using HTML 4. · @David, then is there any other ...
Missing: 427262/ | Show results with:427262/
Oct 20, 2010 · What you could do though is use a separate namespace for your custom attributes. Providing your own DTD for them will not cause validation to ...
Missing: 427262/ | Show results with:427262/
Dec 16, 2014 · You can set any attributes you want to your html elements. If you use jQuery see: http://api.jquery.com/attr/#attr2 $( "#elementID" ).
Missing: 427262/ | Show results with:427262/
Jul 7, 2010 · A new feature being introduced in HTML 5 is the addition of custom data attributes. This is a, seemingly, bizarre addition to the specification ...
Missing: 427262/ | Show results with:427262/
See [Can I just make up attributes on my HTML tags?](http://stackoverflow.com/questions/427262/can-i-just-make-up-attributes-on-my-html-tags) – Matthew ...
... can-i-get-free-vista-style-developer-graphics ... my-app-with-large-pages-in-windows</loc><lastmod>2017-07-04</lastmod> ... https://stackoverflow.com/questions.
Jul 10, 2012 · Can I add a custom attribute to an HTML tag? ... Why should I prepend my custom attributes with "data-"? 7 · Add custom attribute to HTML tags · 1.
Missing: 427262/ | Show results with:427262/