<!DOCTYPE html> <html lang="de"> <head> <meta charset="UTF-8"> <title>Pflegehilfsmittel Kalkulation</title> <style> .button { margin: 5px; padding: 10px; } #cart { margin-top: 20px; } .cart-item { display: flex; justify-content: space-between; } </style> </head> <body> <h1>Pflegehilfsmittel Kalkulation</h1> <script> // Preisvariablen const prices = { bettschutzeinlagen: 12.2, einmalhandschuhe: 10.71, hdFluessig: 8.27, hdTuecher: 8.57, fdFluessig: 6.72, fdTuecher: 28.56, medizinischeMasken: 7.14, ffp2Masken: 15.47, schutzschuerzen: 13.09, fingerlinge: 5.95, esslaetzchen: 11.90 }; </script> <!-- Buttons für Produkte --> <button class="button" onclick="addProduct('25 Stück', 'Bettschutzeinlagen', prices.bettschutzeinlagen)">Bettschutzeinlagen</button> <button class="button" onclick="addProduct('100 Stück', 'Einmalhandschuhe', prices.einmalhandschuhe)">Einmalhandschuhe</button> <button class="button" onclick="addProduct('500 ml', 'Händedesinfektionsmittel', prices.hdFluessig)">HD flüssig</button> <button class="button" onclick="addProduct('60 Stück', 'Händedesinfektionstücher', prices.hdTuecher)">HD-Tücher</button> <button class="button" onclick="addProduct('500 ml', 'Flächendesinfektionsmittel', prices.fdFluessig)">FD flüssig</button> <button class="button" onclick="addProduct('150 Stück', 'Flächendesinfektionstücher', prices.fdTuecher)">FD-Tücher</button> <button class="button" onclick="addProduct('50 Stück', 'Medizinische Masken', prices.medizinischeMasken)">Medizinische Masken</button> <button class="button" onclick="addProduct('20 Stück', 'FFP2 Masken', prices.ffp2Masken)">FFP2 Masken</button> <button class="button" onclick="addProduct('100 Stück', 'Schutzschürzen', prices.schutzschuerzen)">Schutzschürzen</button> <button class="button" onclick="addProduct('100 Stück', 'Fingerlinge', prices.fingerlinge)">Fingerlinge</button> <button class="button" onclick="addProduct('100 Stück', 'Esslätzchen', prices.esslaetzchen)">Esslätzchen</button> <button style="background-color:red; font-weight:bold;" class="button" onclick="initializeCart()">Warenkorb leeren</button> <button style="background-color:red; font-weight:bold;" class="button" onclick="removeLastProduct()">Letztes Element löschen</button> <!-- Buttons für Pakete --> <h2>Pakete</h2> <button class="button" onclick="paket1()">Paket 1</button> <button class="button" onclick="paket2()">Paket 2</button> <button class="button" onclick="paket3()">Paket 3</button> <button class="button" onclick="paket4()">Paket 4</button> <button class="button" onclick="paket5FFP2()">Paket 5 (FFP2)</button> <button class="button" onclick="paket5OP()">Paket 5 (OP)</button> <h2 id="total-price">Gesamtpreis: 0 €</h2> <div id="cart"></div> <script> let totalPrice = 0; const minTotalPrice = 30; const maxTotalPrice = 1000; let cartItems = []; function initializeCart() { totalPrice = 0; cartItems = []; document.getElementById('cart').innerHTML = ''; updateTotalPrice(); } function addProduct(quantity, name, price) { if (totalPrice + price > maxTotalPrice) { alert('Der Gesamtpreis der Produkte kann nicht über ' + maxTotalPrice + ' € liegen.'); return; } totalPrice += price; cartItems.push({ quantity, name, price }); const cart = document.getElementById('cart'); const newItem = document.createElement('div'); newItem.className = 'cart-item'; newItem.innerHTML = `<span>${quantity} ${name}</span><span>${price.toFixed(2)} €</span>`; cart.appendChild(newItem); updateTotalPrice(); } function removeLastProduct() { if (cartItems.length === 0) { alert('Der Warenkorb ist leer.'); return; } const lastItem = cartItems.pop(); totalPrice -= lastItem.price; const cart = document.getElementById('cart'); cart.removeChild(cart.lastElementChild); updateTotalPrice(); } function updateTotalPrice() { document.getElementById('total-price').innerText = 'Gesamtpreis: ' + totalPrice.toFixed(2) + ' €'; } function paket1() { addProduct('25 Stück', 'Bettschutzeinlagen', prices.bettschutzeinlagen); addProduct('25 Stück', 'Bettschutzeinlagen', prices.bettschutzeinlagen); addProduct('100 Stück', 'Einmalhandschuhe', prices.einmalhandschuhe); addProduct('500 ml', 'Flächendesinfektionsmittel', prices.fdFluessig); } function paket2() { addProduct('25 Stück', 'Bettschutzeinlagen', prices.bettschutzeinlagen); addProduct('25 Stück', 'Bettschutzeinlagen', prices.bettschutzeinlagen); addProduct('100 Stück', 'Einmalhandschuhe', prices.einmalhandschuhe); addProduct('100 Stück', 'Einmalhandschuhe', prices.einmalhandschuhe); } function paket3() { addProduct('500 ml', 'Händedesinfektionsmittel', prices.hdFluessig); addProduct('500 ml', 'Händedesinfektionsmittel', prices.hdFluessig); addProduct('500 ml', 'Flächendesinfektionsmittel', prices.fdFluessig); addProduct('100 Stück', 'Einmalhandschuhe', prices.einmalhandschuhe); addProduct('100 Stück', 'Einmalhandschuhe', prices.einmalhandschuhe); } function paket4() { addProduct('60 Stück', 'Händedesinfektionstücher', prices.hdTuecher); addProduct('150 Stück', 'Flächendesinfektionstücher', prices.fdTuecher); addProduct('100 Stück', 'Einmalhandschuhe', prices.einmalhandschuhe); } function paket5FFP2() { addProduct('500 ml', 'Händedesinfektionsmittel', prices.hdFluessig); addProduct('500 ml', 'Händedesinfektionsmittel', prices.hdFluessig); addProduct('100 Stück', 'Einmalhandschuhe', prices.einmalhandschuhe); addProduct('20 Stück', 'FFP2 Masken', prices.ffp2Masken); } function paket5OP() { addProduct('500 ml', 'Händedesinfektionsmittel', prices.hdFluessig); addProduct('500 ml', 'Händedesinfektionsmittel', prices.hdFluessig); addProduct('500 ml', 'Flächendesinfektionsmittel', prices.fdFluessig); addProduct('100 Stück', 'Einmalhandschuhe', prices.einmalhandschuhe); addProduct('50 Stück', 'Medizinische Masken', prices.medizinischeMasken); } </script> </body> </html>
Write, Run & Share HTML code online using OneCompiler's HTML online Code editor for free. It's one of the robust, feature-rich online Code editor for HTML language, running on the latest version HTML5. Getting started with the OneCompiler's HTML compiler is simple and pretty fast. The editor shows sample boilerplate code when you choose language as HTML
. You can also specify the stylesheet information in styles.css
tab and scripts information in scripts.js
tab and start coding.
HTML(Hyper Text Markup language) is the standard markup language for Web pages, was created by Berners-Lee in the year 1991. Almost every web page over internet might be using HTML.
<!DOCTYPE html>
<html>
and ends with </html>
<h1>
to <h6>
where <h1>
is the highest important heading and <h6>
is the least important sub-heading.<p>..</p>
tag.<a>
tag.
<a href="https://onecompiler.com/html">HTML online compiler</a>
<img>
tag, where src
attribute consists of image name.<button>..</button>
tag<ul>
for unordered/bullet list and <ol>
for ordered/number list, and the list items are defined in <li>
.<a href="https://onecompiler.com/html">HTML online compiler</a>
CSS(cascading style sheets) describes how HTML elements will look on the web page like color, font-style, font-size, background color etc.
Below is a sample style sheet which displays heading in green and in Candara font with padding space of 25px.
body{
padding: 25px;
}
.title {
color: #228B22;
font-family: Candara;
}
<table>
tag.<tr>
tag<th>
tag<td>
tag<caption>
tag<script>
is the tag used to write scripts in HTML<script src="script.js"></script>