Home > Web Front-end > HTML Tutorial > Can the HTML tag be deleted after the web page has been displayed_html/css_WEB-ITnose

Can the HTML tag be deleted after the web page has been displayed_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:15:12
Original
1400 people have browsed it

For example, after the browser opens the web page, I click a button to delete a div
Can this be done? How to do it?


Reply to discussion (solution)

What does the original poster mean by using javascript to control the DOM in the page?


It is recommended to learn about it first
http://www.w3school.com.cn/js/index.asp

Then take a look at DHTML

Yes, you can use js/jquery





Untitled Document





< ;div id="new">123





Yes; learn javascript programming, it is recommended not to use jquery


The removeChild method is called by the superior node object, and the parameter is the html object to be removed

removeChild

Bind the click event of the button
In the event:
Find the div to be deleted
Delete the div from the dom tree


That step Nope

http://pan.baidu.com/share/link?shareid=65312&uk=3809368967 This is a demo. You can download it and see it yourself

Thank you everyone, I think I know how to do it. What information did I check? The examples were very helpful to me. Posted a little late.

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template