Selector in jquery 01

Source: Internet
Author: User

<!doctype html>
<meta charset= "gb2312" >
<title> Minister Practice Jqurey</title>
<script src= "Js/jquery-1.11.1.min.js" ></script>
<script>
$ (document). Ready (function (e) {
Select div with ID in div tag
$ (' div[id] '). CSS (' font-size ', ' 50px ');

Select the Class=aa div in the div tag
$ (' div[class=aa] '). HTML (' 1111111111111111 ');

Select the div in the div tag class= start with nav-
$ (' div[class^=nav-] '). CSS (' Color ', ' red ');
});
</script>


<body>
<div id= "DDD" >hello</div>


<div id= "Myd2" >header-div</div>





<div class= "AA" >ok</div>


<div class= "AA" >ff</div>


<div class= "Nav-left" >menu1</div>
<div class= "Nav-right" >menu1</div>
<div class= "Nav-center" >menu1</div>
<div class= "Ok-nav" >menu1</div>
</body>




What the page effect sees:




Selector in jquery 01

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.