Search code examples
javascripttwitter-bootstrapelectron-packager

How can i create a text box at each click


I need to create an empty form and using a button to add as many text box as I want. create a text box with each click. I use the Electron framework. Would anyone have an idea ?


Solution

  • You should do it in javascript. You can use a library like Jquery to do that. I will note give code here, but if you have problem, show your work and it will be a pleasure to help you debug your code.

    There is a lot of way to do it.

    A way to do it: You create a button. You add an event listener on it (listening the click event). Then you give a function to that event listener. This function is responsible for adding the textbox. You can look at the append function of jquery to do that. Or implement your own.

    Hope this help you, comment if something is not clear, I will add more explanation.