This article mainly introduces how to dynamically increase the number of input boxes by clicking a button in a js simple form. It involves the use of javascript Mouse clicking events and insertAdjacentHTML methods, for more information, see the following example. Share it with you for your reference. The details are as follows:
This example shows how to dynamically increase the number of input boxes by clicking the button in the form. By default, there is no input box. After clicking the button, the input box will be continuously increased. It is nice to add one after each click, hope to help you.
Shows the running effect:
The Online Demo address is as follows:
Http://demo.jb51.net/js/2015/js-table-input-button-add-codes/
The Code is as follows:
Click the button to dynamically increase the number of input boxesScript var I = 1 script
I hope this article will help you design javascript programs.