-4
I would like to know how I can add several new div
s in the div
id "new-list-container"
by clicking on the button of id "button"
.
In the Javascript code I created, when I click, creates only one div
and if you click again it doesn’t create another.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./style/css/style.css">
<title>To do list</title>
</head>
<body>
<header>
<div class="page-title">
<h1>To do List</h1>
</div>
</header>
<main>
<div class="create-list">
<input type="text" name="list-title" maxlength="30">
<button id="button" class="btn" onclick="newList()">Criar nova lista</button>
</div>
<div id="new-list-container">
</div>
<div class="remove-all-list">
<div>
<input type="checkbox" name="remove" id="remove">
<label for="remove">Deseja remover todas as listas?</label>
<button class="btn">Remover listas</button>
</div>
</div>
</main>
<footer>
</footer>
<script src="style/js/code.js"></script>
</body>
</html>
Ps: It is the first time I put here so I don’t know how to use the platform very well.
which javascript code creates the div?
– Bruno H.