Einkaufsliste application_liste hinzugefügt
This commit is contained in:
@@ -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;
|
||||
}
|
||||
@@ -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 |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 609 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"));
|
||||
}
|
||||
Reference in New Issue
Block a user