Reputation: 4031
Is this possible. I fill my drop down from different sources. I was thinking of separating different entries odf adding a custom attribute something like this:
<option value="12" customatrribute: "123" >NAME</option>
Upvotes: 3
Views: 9963
Reputation: 157334
The attribute you are using is considered as invalid, if you want to make your own, you need to have data-
prefix as it is valid as per HTML5 specification.
From the specification:
A custom
data
attribute is an attribute in no namespace whose name starts with the string "data-
", has at least one character after the hyphen, isXML-compatible
, and contains no characters in the range U+0041 to U+005A (LATIN CAPITAL LETTER A to LATIN CAPITAL LETTER Z).
So you can use something like
<option value="12" data-customatrribute="123" >NAME</option>
Also note that you need to use =
and not :
As you commented, here's the screenshot of the source, it does show up for me
Upvotes: 8