I get color value with jQuery with .css('color'), and then I know color that it should be.
.css('color')
How can I compare color value that I get from jQuery with for example black color value?
Here is an approach that should work on all browsers using JQuery:
<div id="dummy" style="display:none;"></div>
$('#dummy').css('color','black');
i.e.
if($('#element').css('color') === $('#dummy').css('color')) { //do something }
1.4m articles
1.4m replys
5 comments
57.0k users