Implementation example of jQuery to delete HTML table rows by clicking rows _ jquery

Source: Internet
Author: User
To use some fashionable effects from an HTML table, you only need to click the row and change the row to delete it. This example is relatively simple, new friends can learn about jQuery, which has become one of the most common and favorite JavaScript frameworks at all times. It not only reduces the technical overhead of simple JavaScript encoding, but also makes your code cross-browser compatible. I have already written many jQuery tutorials. At this time, I also use this simple pure implementation. The task is to use some trendy effects from an HTML table, as long as you click the row of the row. The following is the jQuery code to achieve this goal.

$ (Document ). ready (function () {$ ("# sample tr "). click (function () {// change the background color to red before removing((this).css ("background-color", "# FF3700"); $ (this ). fadeOut (400, function () {$ (this ). remove ();});});});

In the above Code, we have attached all the "TR" handlers in the "# example" table. Next, we first change the background of the row, then fade out and delete it. This is a simple task.

Related Article

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.