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:visible‘).hide();
            });
        };
  </script>
 </head>
 <body>
    <div>div1</div>
    <div style="display:none">div2</div>
  <hr/>
  <input type="button" id=‘btnOk‘ value=‘确定‘  />
 </body>
</html>
时间: 2024-07-30 21:52:53

jquery可见性选择器(匹配匹配所有显示的元素)的相关文章

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>

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> &

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> &

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> &

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> &

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>

Jquery过滤选择器,选择前几个元素,后几个元素,内容过滤选择器等

一.基本过滤选择器(重点掌握下列八个):first 选取第一个元素 $("div:first").css("color","red");:last 选取最后一个元素 $("div:last").css("color","red");:not 除去指定的选择器外的元素 $("div:not").css("color","red")

jQuery可见性选择器

:hidden:表示查询所有隐蔽的标签:visible:表示查询所有显示的标签或:not(:hidden) <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <script type="text/javascript" src="../js/jquery-1.6.js"&g

[ jquery 过滤器 is(expr | jqObj | ele | function) ] 此方法用于在选择器的基础之上根据选择器、DOM元素或 jQuery 对象来检测匹配元素集合,如果有,则返回true

根据选择器.DOM元素或 jQuery 对象来检测匹配元素集合,如果其中至少有一个元素符合这个给定的表达式就返回true. 如果没有元素符合,或者表达式无效,都返回'false'. '''注意:'''在jQuery 1.3中才对所有表达式提供了支持.在先前版本中,如果提供了复杂的表达式,比如层级选择器(比如 + , ~ 和 > ),始终会返回true 实例: <!DOCTYPE html> <html lang='zh-cn'> <head> <title&