Enhanced basic selector [selector_3.html]

Source: Internet
Author: User

Enhanced basic selector [selector_3.html]
$ ("ul Li:first")
$ ("ul Li:last")
$ ("Table Tr:even")
$ ("Table tr:odd")
$ ("Table Tr:eq (0)")
$ ("Table tr:gt (0)")
$ ("Table Tr:lt (2)")
$ (": Header")
$ (": Checkbox:not (: Checked)") Select all unchecked check boxes.

1 <HTML>2   <Head>3     <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8">4     <Scripttype= "Text/javascript"src=".. /js/jquery-1.8.2.js "></Script>5   </Head>6   <Body>7     <ul>8         <Li>List Item 1</Li>9         <Li>List Item 2</Li>Ten         <Li>List Item 3</Li> One         <Li>List Item 4</Li> A         <Li>List Item 5</Li> -     </ul> -     <inputtype= "checkbox"checked/> the     <inputtype= "checkbox"checked/> -     <inputtype= "checkbox"/> -     <TableBorder= "1"> -       <TR><TD>LINE1[0]</TD></TR> +       <TR> -           <TD>LINE2[1]</TD> +       </TR> A       <TR><TD>LINE3[2]</TD></TR> at     </Table>     -     <H1>H1</H1> -     <H2>H2</H2> -     <H3>H3</H3> -     <H3>H4</H3> -     <H3>H5</H3> in     <H3>H6</H3> -     <P>P</P> to     <Scripttype= "Text/javascript"> +     /*1) Find the content of the first element in UL - Alert ($ ("ul Li:first"). html ()); the         */ *         //Alert ($ ("ul Li:last"). html ()); $       /*2) Find the content of the last element in ULPanax Notoginseng Alert ($ ("ul Li:last"). html ()); -         */ the            +       /*4) The number of rows for which the index value of the lookup table is even, 0,2,4,6,... A Alert ($ ("Table Tr:even"). Size ()); the           */ +        - Alert ($ ("Table Tr:odd"). Size ()); $       /*5) The number of rows for which the index value of the lookup table is odd, 1,3,5,7,... $ Alert ($ ("Table Tr:odd"). Size ()); -           */ -        the       /*6) Find the contents of the second row in the table, starting with index number 0 - var $tr = $ ("Table Tr:eq (1)");Wuyi var html = $tr. HTML (); the alert (HTML); -           */ Wu Alert ($ ("table Tr:eq (1)"). HTML ()); -       /*7) Find the number of the second third row in the table, that is, the index value is 1 and 2, which is greater than 0 About var $tr = $ ("Table tr:gt (0)"); $ var size = $tr. Size (); - alert (size); -           */  -  A       /*8) Find the number of the first second row in the table, that is, the index value is 0 and 1, which is less than 2 + var $tr = $ ("Table Tr:lt (2)"); the var size = $tr. Size (); - alert (size); $           */  the        the       /*9) Add a red background color to all headings in the page  the $ (": Header"). CSS ("Background-color", "Red"); the           */ -           $(": Header"). CSS ("Background-color","Red"); in       //3) Find out the number of all unchecked input elements the Alert ($ (": Checkbox:not (: Checked)"). Size ()); the            About        the     </Script> the   </Body> the </HTML>

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.