In my project I need to make sure if I can apply a particular CSS property to an HTML element. For example, I need to check if 'color' property is supported by 'img' tag. I remember reading somewhere that the code below could be used to check it.
var image = document.createElement('img');
if(image.style.color)
image.style.color = "blue";
But this is returning wrong result. If someone knows how it is possible to check if a property is supported by an html element, then please answer.
Thanks.