The example in this article describes the element selector usage in jquery. Share to everyone for your reference. The specific analysis is as follows:
This selector can match the element with the specified label name. For example:
Copy Code code as follows:
The above code can select all the DIV elements.
syntax Structure:
Copy Code code as follows:
parameter list:
| Parameters |
Describe |
| Element |
An element to search for. The label name that points to the DOM node. |
Instance code:
Copy Code code as follows:
<! DOCTYPE html>
<meta charset= "Utf-8"/>
<meta name= "Author" content= "http://www.jb51.net/"/>
<title> element Selector-cloud-Habitat Community </title>
<script type= "Text/javascript" src= "Mytest/jquery/jquery-1.8.3.js" ></script>
<script type= "Text/javascript" >
$ (document). Ready (function () {
$ ("span"). CSS ("Color", "green");
})
</script>
<body>
<div>jquery Zone </div>
<div>div+css Zone </div>
<p>javascript Zone </p>
<span>html Zone </span>
</body>
The above code can set the font color in the span element to green.
I hope this article will help you with your jquery programming.