<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <title>JQ判断某个div是否含有某个div样式</title> <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script> </head> <body> <style> .lala{ color:red; margin:10vh; cursor:pointer; } </style> <div class="lala noStyle"> <span class="number">89</span> <span class="heart">❤</span> </div> </body> </html> <script> $(function(){ if($(".lala").css('color')=="rgb(255, 0, 0)"){ alert(000) } }) </script>