Copy Code code as follows:
<!--
Content Filter Selector: Gets the element based on the text content in the element or the contained child element feature, and the text content can be positioned in a fuzzy or absolute match
jquery Selector Detailed
Depending on the elements in the obtained page, you can divide the jquery selector into: basic selector, hierarchy selector, filter selector, form selector four categories. Among them, in the filter selector can be divided into: Simple filter selector, Content filter selector, visibility filter selector, attribute filter selector, child element filter selector, Form object attribute filter Selector 6 kinds
-->
<title></title>
<!--Use the jquery content filter selector to select elements: In the page, create four <div> tags as needed and add a <span> tag to the <div> in which the remaining <div> tag, get the specified element from the content filter and display it in the page. -->
<script src= "Jquery-1.9.1.js" type= "Text/javascript" ></script>
<style type= "Text/css" >
Body{font-size:12px;text-align:center}
Div{float:left;border:solid 1px #ccc; Margin:8px;width:65px;height:65px;display:none}
Span{float:left;border:solid 1px #ccc; Margin:8px;width:45px;height:45px;background-color: #eee}
</style>
<script type= "Text/javascript" >
$ (function () {//display elements containing given text
$ ("Div:contains (' A ')"). CSS (' Display ', ' block ');
})
$ (function () {//display all empty elements that do not contain child elements or text
$ (' Div:empty '). CSS (' Display ', ' block ');
})
$ (function () {//display element with selector matching
$ (' Div:has (span) '). CSS (' Display ', ' block ');
})
$ (function () {//Display elements that contain child elements or text
$ (' div:parent '). CSS (' Display ', ' block ');
})
</script>
<!--Note: In: Contains (text) content Filter selector, if you are looking for letters, there are case differences-->
<body>
<div>ABCD</div>
<div><span></span></div>
<div>EFAH</div>
<div></div>
</body>