**i am trying to put an event handler based on CSS condition and it doesn't work,any help please ** here is my HTML code :
<!Doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jquery test</title>
<style>
.x{color:red;}
</style>
</head>
<body>
<input id="trigger" type="button" value="test"/>
<p class="x" >some text</p>
<p>another text</p>
<script type="text/javascript" src="js/jQuery.js"></script>
<script type="text/javascript" src="js/match.js"></script>
</body>
</html>
and here is the jquery code :
$('#trigger').click(function(){
if($('p.x').css("color") === "red")
{
var text= $('p').text();
alert(text);
}
});