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