Home > Web Front-end > JS Tutorial > jquery delete specified child element code example_jquery

jquery delete specified child element code example_jquery

WBOY
Release: 2016-05-16 16:20:33
Original
1654 people have browsed it

jquery code example for deleting specified child elements:
This chapter introduces how to use jQuery to delete specified child elements.
How to use native javascript to implement this function can be found in the Native javascript deletion of specified sub-element code example chapter.
In fact, there are many ways to implement this function. The following is an introduction to one of the more common ones.
The code example is as follows:

Copy code The code is as follows:




Script Home


<script><br> $(document).ready(function(){<br> $("#bt").click(function(){<br> $($("#box").find("li")[1].remove());<br> })<br> })<br> </script>



  • Script House welcomes you, only by working hard can we have a better tomorrow.

  • No one is a master from the beginning, they have to work hard.

  • Every day is new, so cherish your time.





The above code achieves our requirements. It is relatively simple and will not be introduced here. For more information, please refer to related readings.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template