您可以使用.is(':visible')选择所有可见的元素。
<html> <head> <title>divvisible</title> <script src="../../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { $("button").click(function () { var dim = $('#div1').is(":visible"); if (dim == false) { $('#div1').css({ "display": "block", "color": "red" }); } }); }); </script> </head> <body> <div id="div1" style="display:none"> <p>Div is visible</p> </div> <button type="button" id="btn" onclick="click()">Click Here</button><br /> </body> </html>