Jquery changes the background color when you move the cursor over a table row.

Source: Internet
Author: User

Today is the first day of learning jquery. I have read it before, but I have never been so keen to learn it. Today, I am so eager to learn it.

Jquery events remove the on in JS. For example, onclick is click in jquery.

The following is an example I wrote today. The background color is changed when you place the cursor over the row.

<% @ Page Language = "C #" autoeventwireup = "true" codebehind = "default. aspx. cs" inherits = "jquery_learning. _ default" %> <br/> <! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <br/> <HTML xmlns = "http://www.w3.org/1999/xhtml"> <br/> <pead runat = "server"> <br/> <title> No title page </title> <br/> <MCE: script src = "jquery. JS "mce_src =" jquery. JS "type =" text/JavaScript "> </MCE: SCRIPT> <br/> <MCE: script src =" jquery-1.2.6-intellisense.js "mce_src =" jquery-1.2.6-intellisense.j S "type =" text/JavaScript "> </MCE: SCRIPT> <br/> <MCE: Script Type =" text/JavaScript "> <! -- <Br/> $ (function () {<br/> $ ("# tb tr "). mouseover (function () {<br/> $ (this ). addclass ("TD1"); <br/>}); <br/> $ ("# tb tr "). mouseout (function () {<br/> $ (this ). removeclass ("TD1"); <br/>}); </P> <p >}); <br/> // --> </MCE: SCRIPT> <br/> <link href = "css.css" mce_href = "css.css" type = "text/CSS" rel = "stylesheet"/> <br/> <MCE: style type = "text/CSS"> <! -- <Br/> Th {<br/> background-color: Green ;}< br/>. TD1 {background-color: Silver ;}< br/> --> </MCE: style> <style type = "text/CSS" mce_bogus = "1"> Th {<br/> background-color: Green ;}< br/>. TD1 {background-color: Silver ;} </style> <br/> </pead> <br/> <body> <br/> <Form ID = "form1" runat = "server"> <br/> <Table id = "TB"> <br/> <tr> <br/> <TH> name </Th> <br/> <TH> age </Th> <br/> <TH> nationality </Th> <br/> <TH> mobile phone </Th> <br/> </tr> <br/> <tr> <br /> <TD> phosphatase </TD> <br/> <TD> zweizig </TD> <br/> <TD> Shanghai </TD> <br/> <TD> 13088888888 </TD> <br/> </tr> <br/> <TD> PLD </TD> <br/> <TD> zweizig </TD> <br/> <TD> Shanghai </TD> <br/> <TD> 13088888888 </TD> <br/> </tr> <br/> <tr> <br/> <TD> phosphatase </TD> <br/> <TD> zweizig </TD> <br/> <TD> Shanghai </TD> <br/> <TD> 13088888888 </TD> <br/> </tr> <br/> <TD> phosphatase </TD> <br/> <TD> zweizig </TD> <br/> <TD> Shanghai </TD> <br/> <TD> 13088888888 </TD> <br/> </tr> <br/> <TD> phosphatase </TD> <br/> <TD> zweizig </TD> <br/> <TD> Shanghai </TD> <br/> <TD> 13088888888 </TD> <br/> </tr> <br/> <TD> </TD> <br/> <TD> zweizig </TD> <br/> <TD> Shanghai </TD> <br/> <TD> 13088888888 </TD> <br/> </tr> <br/> <TD> phosphatase </TD> <br/> <TD> zweizig </TD> <br/> <TD> Shanghai </TD> <br/> <TD> 13088888888 </TD> <br/> </tr> <br/> <tr> <br/> <TD> phosphatase </TD> <br/> <TD> zweizig </TD> <br/> <TD> Shanghai </TD> <br/> <TD> 13088888888 </TD> <br/> </tr> <br/> <TD> PLD </TD> <br/> <TD> zweizig </TD> <br/> <TD> Shanghai </TD> <br/> <TD> 13088888888 </TD> <br/> </tr> <br /> </table> <br/> </form> <br/> </body> <br/> </ptml> <br/> 

 

I just want to write it in a simple way. If you want to learn more advanced, check what the experts wrote.

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.