Copy codeThe Code is as follows: <Head>
<! --
1. Basic selector: the most frequently used selector in jQuery. It consists of element Id, Class, element name, and multiple selector. The basic selector can be used to search for most page elements.
JQuery selector details
Based on the elements in the obtained page, jQuery selectors can be divided into four categories: Basic selector, level selector, filter selector, and form selector. There are six filter selectors: simple filter selector, content filter selector, visibility filter selector, attribute filter selector, child element filter selector, and form object attribute filter selector.
-->
<Title> </title>
<! -- Use the jQuery basic selector to select an element. A page contains two <div> tags, one for setting the ID attribute and the other for setting the Class attribute. we add another <span> tag, all element initial values are hidden, and the corresponding page tag is displayed through the jQuery basic selector. -->
<Script src = "jquery-1.9.1.js" type = "text/javascript"> </script>
<Style type = "text/css">
Body {font-size: 12px; text-align: center ;}
. ClsFrame {width: 300px; height: 100px}
. ClsFrame div, span {display: none; float: left; width: 65px; height: 65px; border: solid 1px # ccc; margin: 8px}
. ClsOne {background-color: # eee}
</Style>
<Script type = "text/javascript">
$ (Function () {// ID Matching Element
Certificate ('audio divone'audio .css ('display', 'block ');
})
$ (Function () {// element name Matching Element
$ ('Div span'mirror.css ('display', 'block ');
})
$ (Function () {// class Matching Element
$ ('. ClsFrame .clsone'hangzhou.css ('display', 'block ');
})
$ (Function () {// match all elements
$ ('* 'Mirror.css ('display', 'block ');
})
$ (Function () {// merge matching elements
Vertex ('audio divone,span'audio .css ('display', 'block ');
})
</Script>
</Head>
<Body>
<Div class = "clsFrame">
<Div id = "divOne">
ID </div>
<Div class = "clsOne">
CLASS </div>
<Span> SPAN </span>
</Div>
</Body>
</Html>