Like everyone knows we can style an element using CSS like below
#a {
background-color : green;
}
And using JS
document.getElementById('a').style.backgroundColor = "green";
But I would like to create some property like background-color
and that can be used inside CSS. For example I will create a property like "foobar" then I should be able to use it like below
#a {
foobar : value;
}
Is this possible? I would like to execute some JS on the element that includes this property.
Answers in the question referred to as a duplicate were how to create new CSS and add it to the style sheets using existing CSS properties. But here I am trying to create my own css property...