I'm using jQuery to check if a particular CSS property and value exist. Why doesn't it work? I'm expecting to see the 'yes' log.
$(document).ready(function() {
if ($('p').css('color') === 'blue') {
console.log('yes');
} else {
console.log('no');
}
});
p {
color: blue;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<p>text</p>