<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Untit…
测试代码: 07-子元素过滤选择器.html <!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> <meta ht…
jQuery选择器内容过滤 一.:contains(text) 选择器::contains(text)描述:匹配包含给定文本的元素返回值:元素集合 示例: ? 1 2 $("div.mini:contains('div')") //div.mini是DOM元素集合,:contains('div')是过滤条件 二.:has(selector) 选择器::has(selector)描述:匹配含有选择器所匹配的元素的元素返回值:元素集合 示例: ? 1 2 $("div.mini:…
1.表格代码如下: <table id="table"> <tr> <td>id</td> <td>name</td> </tr> <tr> <td>1</td> <td>aaa</td> </tr> <tr> <td>2</td> <td>bbb</td> </tr…
此选择器主要是对所选择的表单元素进行过滤: 选择器 描述 返回 enabled 选择所有的可用的元素 集合元素 disabled 选择所有的不可用的元素 集合元素 checked 选择所有被选中的元素(单选框,复选框) 集合元素 selected 选择所有被选中选项元素(下拉列表) 集合元素 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd&q…
:nth-child('索引值')//获取指定元素下的某个子元素的位置,索引从1开始: //偶数行                 //$('li:nth-child(even)').addClass('class1'); //奇数行                 //$('li:nth-child(odd)').addClass('class1'); //第一行 //$('li:nth-child(1)').addClass('class1');                 //$('l…
1.介紹 2.程序 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> <style type="text/css"> div, span, p { width: 140px; height: 140px; margin: 5px; background: #aaa…
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>子(后代)元素过滤选择器</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <script type…
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <title></title> <link rel="stylesheet" href="imooc.css" type="text/css&…
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>使用jQuery表单对象属性过滤选择器 </title> <meta charset="utf-8"> <script language="javascript" type="text/javascript" src="jquery-3.…