I'm trying to add this piece of code to my EJS whenever a button is clicked.
<div>
<input type="checkbox" class="checkBox">
<input type="text" class="textField">
<hr>
</div>
Form code:
<form action="/add" method="POST">
<input class="textField" type="text" name="newItem" placeholder="New Task" required>
<button type="submit" class="btn btn-md btn-task" id="buttonAdd">New Task</button>
</form>
My webpage consists of a list, the user can add as many tasks as they want whenever the button inside the form is clicked. How do I make this functionality work and how do I write it in code?
In my current code, whenever a task is added, it disappears.