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