The user clicks one of the buttons to add 1 to the number, and clicks the other button to decrement the number by 1. If the button is held down, the value in the text box will increase or decrease faster, which is a variable-speed accelerator. Function.
For example, if you open the "Time and Date Properties" window on your computer, and you press the up and down buttons marked in the red box in the picture to adjust the time, try clicking and holding down the mouse, you will find that its function is the same as what I said. The same (accurately speaking, there is a difference. If you press the mouse and hold down the addition speed, it will be faster, but it will not get faster and faster. In my example, the addition will get faster and faster, which is more suitable for data supply occasions with relatively large values) .
The code is very simple and has comments. I don’t know if the implementation is scientific enough. If you have better suggestions, please share them with me. The HTML and JavaScript codes are as follows: