jquery Delete specified LI element brief introduction

Source: Internet
Author: User

jquery deletes the specified LI element in a brief introduction:

This section describes how to use jquery to delete the specified Li elements, although relatively simple, but this is a more common operation, may be a lot of beginners are not enough to understand, the following code examples to explain how to implement this function, the code is as follows:

<!DOCTYPE HTML><HTML><Head><MetaCharSet= "Utf-8"><Metaname= "Author"content= "http://www.51texiao.cn/" /><title>Ant Tribe</title><styletype= "Text/css">ul Li{List-style:None;font-size:12px;Line-height:25px; }  </style> <Scriptsrc= "Http://libs.baidu.com/jquery/1.9.0/jquery.js"></Script><Scripttype= ' Text/javascript '>$ (document). Ready (function(){  $("#bt"). Click (function(){    $("Li"). EQ (1). Remove (); })})</Script></Head> <Body> <ulID= "box">   <Li>Ant Tribe welcome you, only hard struggle will have a better tomorrow.</Li>   <Li>No one is a master at the beginning, must learn through an open mind.</Li>   <Li>Every day is new, cherish it well.</Li>   <Li>Only the present time is real, the next second is unreal.</Li>   <Li>The spirit of sharing and the bosom of mutual help are the greatest source of progress.</Li> </ul> <inputtype= "button"ID= "BT"value= "View Effect"/></Body> </HTML>

The above Code click button can delete the second Li element, the code is relatively simple here is not more introduction.

Related reading:

The 1.eq () function can be found in the section on the EQ () method of jquery.

The 2.remove () function can be found in the Remove () method section of jquery.

The original address is: http://www.51texiao.cn/jqueryjiaocheng/2015/0713/6599.html

The most original address is: http://www.softwhy.com/forum.php?mod=viewthread&tid=15055

jquery Delete specified LI element brief introduction

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.