jquery Basic Learning 6--Base Selector

Source: Internet
Author: User

1<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">234<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>5<title>2-4</title>6<link rel= "stylesheet" type= "Text/css" href= "Css/style.css"/>7<!--introducing jquery--8<script src= ". /scripts/jquery.js "type=" Text/javascript "></script>9<script src= "Lib/assist.js" type= "Text/javascript" ></script>Ten          One<script type= "Text/javascript" > A$ (document). Ready (function(){ -                 //Select an element with an ID of one -$ (' #btn1 '). Click (function(){ the$ (' #one '). CSS ("Background", "#bfa"); -                 }); -                   -                 //Select all elements of class mini +$ (' #btn2 '). Click (function(){ -$ ('. Mini '). CSS ("Background", "#bfa"); +                 }); A                  at                 //Select element name is all elements of div -$ (' #btn3 '). Click (function(){ -$ (' div '). css ("Background", "#bfa"); -                 }); -                  -                 //Select all the elements in$ (' #btn4 '). Click (function(){ -$ (' * '). CSS ("Background", "#bfa"); to                 }); +                  -                 //Select all the span elements and the DIV element with ID the$ (' #btn5 '). Click (function(){ *$ (' span, #two '). CSS ("Background", "#bfa"); $                 }); Panax Notoginseng             }); -</script> the +<body> A  the<button id= "reset" > Reset page elements manually </button> +<input type= "checkbox" id= "Isreset" checked= "checked"/><label for= "isreset" > Reset page automatically when clicking the button below </label ><br/><br/> - $  $<!--control buttons-- -<input type= "button" value= "selects the element with ID one." id= "Btn1"/> -<input type= "button" value= "selects all elements of Class Mini." Id= "btn2"/> the<input type= "button" value= "SELECT element name is all elements of Div." id= "Btn3"/> -<input type= "button" value= "selects all elements." id= "Btn4"/>Wuyi<input type= "button" value= "selects all of the span elements and the element with ID." Id= "Btn5"/> the  -<br/><br/> Wu  -<!--test Elements-- About<div class= "One" id= "one" > $ div with id one,class as one -<div class= "Mini" >class for mini</div> -</div> -  A<div class= "One" id= "one" title= "Test" > + The div with ID two,class is one,title as test. the<div class= "Mini" title= "other" >class Mini,title for Other</div> -<div class= "Mini" title= "test" >class Mini,title for Test</div> $</div> the  the<div class= "One" > the<div class= "Mini" >class for mini</div> the<div class= "Mini" >class for mini</div> -<div class= "Mini" >class for mini</div> in<div class= "Mini" ></div> the</div> the  About<div class= "One" > the<div class= "Mini" >class for mini</div> the<div class= "Mini" >class for mini</div> the<div class= "Mini" >class for mini</div> +<div class= "Mini" title= "Tesst" >class to Mini,title for tesst</div> -</div> the Bayi  the<div style= "Display:none;" class= "None" > theThe style's display is "none"the Div -</div> -  the<div class= "Hide" >class as "Hide" div</div> the  the<div> theContains the type of input "hidden" div<input type= "hidden" size= "8"/> -</div> the  the<span id= "Mover" > the span element in which the animation is being performed .</span> the 94</body> the

      1. $ (' #one '). CSS ("Background", "#bfa"); Change the background color of an element with ID one.

      1. $ ('. Mini '). CSS ("Background", "#bfa"); Change the background color of all elements of class mini

      1. $ (' div '). css ("Background", "#bfa"); Changing the element name is the background color of all elements of <div>

      1. $ (' * '). CSS ("Background", "#bfa"); Change the background color of all elements

      1. $ (' span, #two '). CSS ("Background", "#bfa"); Change the background color of all <span> elements and the element with ID

jquery Basic Learning 6--Base Selector

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.