淘先锋技术网

首页 1 2 3 4 5 6 7
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
<script type="text/javascript" src="jquery/jquery-1.11.1.js"></script>
<script type="text/javascript">
         $(function(){
                //选择class为one下的所有的隐藏的子元素(这个是先选class="one"的元素,然后再选隐藏的(是class=one的子元素))
                alert($(".one :hidden").length);
                //选择隐藏为class等于one的元素(先选隐藏的,再选class=”one“的元素)
        	 alert($(".one:hidden").length);
       });

</script>
</head>
<body>

              <div style="display:block;"  class="one">1111111111111111111</div>
              <div style="display: none;"  class="one">1111111111111111111</div>
              <div style="display: none;"  class="one">1111111111111111111</div>

      <div class="one">
              <div style="display: none;">1111111111111111111</div>
              <div style="display: none;">1111111111111111111</div>
              <div style="display: none;">1111111111111111111</div>
              <div style="display: none;">1111111111111111111</div>
              <div style="display: none;">1111111111111111111</div>
              <div  style="display: none;"  class="one">1111111111111111111</div>
      </div>
</body>
</html>