Simple example of adding and removing HTML nodes

Simple example of adding and removing HTML nodes

Simple example of adding and removing HTML nodes Simple example of adding and removing HTML nodes
<input type="button" onclick="appendnode()" value="Add node">
<input type="button" onclick="removenode()" value="Delete node">
<div id="result"></div>
<script>
i=0
function appendnode() {
o=document.createElement("DIV");
o.innerHTML="test" i
document.getElementById('result').appendChild(o);
i
}
function removenode(){
var x = document.getElementById('result');
x.removeChild(x.lastChild) //Delete from the last node
}
</script>

<<:  Pitfalls based on MySQL default sorting rules

>>:  Example of how to set up a multi-column equal height layout with CSS

Recommend

Overview of the basic components of HTML web pages

<br />The information on web pages is mainly...

Detailed steps for Python script self-start and scheduled start under Linux

1. Python automatically runs at startup Suppose t...

Summary of four ways to introduce CSS (sharing)

1. Inline reference: used directly on the label, ...

JavaScript immediate execution function usage analysis

We know that in general, a function must be calle...

Several ways of running in the background of Linux (summary)

1. nohup Run the program in a way that ignores th...

MySQL 8.0.15 installation and configuration method graphic tutorial

This article records the installation and configu...

HTML+css to create a simple progress bar

1. HTML code Copy code The code is as follows: Ex...

How to check disk usage in Linux

1. Use the df command to view the overall disk us...

Best Practices for Implementing Simple Jira Projects with React+TS

A set of projects for training react+ts Although ...

Sqoop export map100% reduce0% stuck in various reasons and solutions

I call this kind of bug a typical "Hamlet&qu...

Solution to high CPU usage of Tomcat process

Table of contents Case Context switching overhead...