Einkaufsliste application_liste hinzugefügt

This commit is contained in:
Andrea Gaertner
2020-06-03 09:04:57 +02:00
parent 190061ea87
commit 668e16c315
7868 changed files with 850301 additions and 272 deletions
+14
View File
@@ -0,0 +1,14 @@
body {
background-color: lightblue;
text-align: center;
}
div {
padding-top: 20px;
border-style: groove;
border-color: black;
background-image: url("../img/schriftrolle.png");
background-repeat: no-repeat;
background-position: center top;
margin-left: 300px;
margin-right: 300px;
}
+31
View File
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Einkaufsliste</title>
<link rel="icon" href="img/ohm.ico">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div id="ueberschrift">
<h2>
Einkaufsliste
<img src="img/kisspng-shopping-bag-grocery-store-shopping-cart-vegetable-bag2-myspeedyx-5cb7cce50fbf87.6493526215555494130645.png" id="einkaufstüte" width="50" height="50" />
</h2>
</div>
<div class="navbar">
<a href="#" class="active">Home</a>
<a href="#">Link</a>
<a href="#">Link</a>
<a href="#" class="right">Link</a>
</div>
<div id="liste">
</div>
<input type="text" id="element" ondblclick="onClick()" />
<input type="button" id="button1" value="Hinzufügen" onclick="onClick()" />
<script src="scripts/einkaufsliste.js"></script>
</body>
</html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 446 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 KiB

@@ -0,0 +1,27 @@
var counter = 0;
function onClick() {
var element = document.getElementById("element");
console.log(element.value);
add(element.value);
}
function add(input) {
counter++;
var liste = document.getElementById("liste");
var checkbox = document.createElement("input");
checkbox.setAttribute("type", "checkbox");
checkbox.setAttribute("id", "cb" + counter);
var label = document.createElement("label");
label.innerHTML = input;
label.setAttribute("for", "cb" + counter);
liste.appendChild(checkbox);
liste.appendChild(label);
liste.appendChild(document.createElement("br"));
}