html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<div class="offer">
<!-- KÁVA -->
<input type="button" value="30 espresso" name="espresso">
<input type="button" value="45 cappucino" name="cappucino">
<input type="button" value="55 latte" name="latte">
<!-- NEALKO -->
<input type="button" value="50 limonada" name="limonada">
<input type="button" value="60 ledový čaj" name="ledový čaj">
<input type="button" value="10 voda" name="voda">
<!-- COCKTAIL -->
<input type="button" value="80 mojito" name="mojito">
<input type="button" value="90 gin tonic" name="gin tonic">
<input type="button" value="80 cuba libre" name="cuba libre">
<!--PŘEDKRM -->
<input type="button" value="60 polévka" name="polévka">
<input type="button" value="100 kozí sýr" name="salát kozí sýr">
<input type="button" value="150 carpaccio" name="carpaccio">
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* NÁZEV POLOŽKY */
.result{
width: 300px;
height: 300px;
}
.result2{
width: 150px;
height: 30px;
text-align: left;
}
.storno{
width: 30px;
height: 300px;
position: absolute;
left: 5%;
}
/* CENA */
.totalPrice{
width: 150px;
height: 300px;
position: absolute;
top: 62.5%;
left: 21%;
}
.totalPrice2{
width: 150px;
Enter to Rename, Shift+Enter to Preview
js
js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// HTML
let HTMLstructure= function(oneItem){
const newDiv= document.createElement("div")
const newSpan= document.createElement("span")
const button= document.createElement("button")
const secSpan= document.createElement("span")
// storno BTN a vypsáni položky
button.textContent="x"
button.style.cssText= `margin-right: 10px;`
newDiv.appendChild(button)
button.addEventListener("click", function(){
removeOrder(oneItem.id)
newHTML()
})
newSpan.textContent= `${oneItem.item}`
secSpan.textContent=`${oneItem.number}`
secSpan.style.cssText= `padding: 0px 60px;`
newDiv.appendChild(newSpan)
newDiv.appendChild(secSpan)
return newDiv
}
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run