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?
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
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.