jquery可见性选择器(综合)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title>可见性选择器</title>
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
  <style type="text/css">
  .yang{ border-collapse: collapse; width:500px;height:30px;border:1px solid red;"}
  </style>
  <script  type="text/javascript" src="jquery-1.7.1.min.js"></script>
  <script type="text/javascript">
  /*
    :hidden  //匹配所有隐藏的元素
    :visible   //匹配所有显示的元素
  */
        window.onload=function(){
        $('#btnOk').click(function(){
           //匹配匹配所有隐藏的div
            $('div:hidden').show();
          //匹配匹配所有显示的div
            $('div:visible').hide();
            });
        };
  </script>
 </head>
 <body>
    <div>div1</div>
    <div style="display:none">div2</div>
  <hr/>
  <input type="button" id='btnOk' value='确定'  />
 </body>
</html>
原文地址:https://www.cnblogs.com/yangzailu/p/5845494.html