From this code:
HTML
<div class="test"></div>
CSS
.test {
background-color:red;
font-size:20px;
-custom-data1: value 1;
-custom-data2: 150;
-custom-css-information: "lorem ipsum";
}
With javascript -- for example from a $('.test')
-- how can I get a list of the CSS attributes wich have the property name starting with the prefix "-custom-" ?
(they can have various name, but always the same prefix)
I would like to get this:
{
customData1: "value 1",
customData2: 150,
customCssInformation: "lorem ipsum"
}
I know that I can also use the data-
HTML attribute, but for some very specifics reasons I need to use a CSS equivalent. Thanks for your help.