CSS Design Table (middle)--jquery Implementation delete the specified row

Source: Internet
Author: User

Preface

In the previous section, we implemented a style table with CSS, and added a full selection feature, this section uses jquery to implement the deletion of the specified line function. The following effect diagram:

This chapter sample code point this download

Implementation Code

table3.html Content

<! DOCTYPE html>  

Comparing the table2.html content of the previous section, only a few lines of code were added, the following changes were made for <a></a>

<a title= "Delete" onclick= "Article_del (This)" href= "javascript:;" > Delete </a>

Where the onclick is obviously the function executed for the <a> click event.

Where href= "javascript:;" Maybe some beginners don't understand. The href attribute of the <a> tag specifies that the value of the Url,href property of the hyperlink target can be a relative or absolute URL for any valid document, including fragment identifiers and JavaScript code snippets. Here's href= "javascript:;", where JavaScript: is a pseudo-protocol that allows us to invoke JavaScript functions through a link, and in this way javascript: can implement a-tag click event Runtime, If the page content is many, there are scrollbars, the page will not jump, the user experience is better. Perhaps you will think, with href= "#", I can only say, try ~

Conclusion

Next section write dynamic add row

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.