Home>

The effect is shown in the following figure:

The online demo address is as follows:

The specific code is as follows:

<! Doctype html public "-//w3c //dtd xhtml 1.0 transitional //en"
"http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title>Click the button to dynamically increase the number of input boxes</title>
</head>
<body>
<script>var i=1</script>
<input type=button onclick="document.body.insertadjacenthtml (" beforeend ","<input type=text name="+ i +" value="+ i +++">")" value=add>
</body>
</html>
  • Previous MYSQL create function error solution
  • Next Jquery SweetAlert plugin implements responsive prompt box