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 }
2.1m questions
2.1m answers
60 comments
57.0k users