Compare commits
2 Commits
2deccd57ce
...
e49ff26641
| Author | SHA1 | Date |
|---|---|---|
|
|
e49ff26641 | 8 months ago |
|
|
67d12d625e | 8 months ago |
@ -0,0 +1,76 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="de">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Bitwert Berechnung</title>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
padding: 20px;
|
||||||
|
background-color: #f4f4f4;
|
||||||
|
}
|
||||||
|
label {
|
||||||
|
display: block;
|
||||||
|
margin: 5px 0;
|
||||||
|
}
|
||||||
|
input {
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
#result {
|
||||||
|
margin-top: 20px;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Wochentage Bitwert Berechnung</h1>
|
||||||
|
<form id="bitForm">
|
||||||
|
<label><input type="checkbox" name="MiV" value="1"> MiV</label>
|
||||||
|
<label><input type="checkbox" name="MiN" value="2"> MiN</label>
|
||||||
|
<label><input type="checkbox" name="DoV" value="4"> DoV</label>
|
||||||
|
<label><input type="checkbox" name="DoN" value="8"> DoN</label>
|
||||||
|
<label><input type="checkbox" name="FrV" value="16"> FrV</label>
|
||||||
|
<label><input type="checkbox" name="FrN" value="32"> FrN</label>
|
||||||
|
<label><input type="checkbox" name="SaV" value="64"> SaV</label>
|
||||||
|
<label><input type="checkbox" name="SaN" value="128"> SaN</label>
|
||||||
|
<label><input type="checkbox" name="SoV" value="256"> SoV</label>
|
||||||
|
<label><input type="checkbox" name="SoN" value="512"> SoN</label>
|
||||||
|
<label><input type="checkbox" name="Abbau" value="1024"> Abbau</label>
|
||||||
|
<br><br>
|
||||||
|
<button type="button" onclick="calculateBitValue()">Berechne Gesamtbitwert</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div id="result"></div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const TAGE = {
|
||||||
|
"MiV": 1,
|
||||||
|
"MiN": 2,
|
||||||
|
"DoV": 4,
|
||||||
|
"DoN": 8,
|
||||||
|
"FrV": 16,
|
||||||
|
"FrN": 32,
|
||||||
|
"SaV": 64,
|
||||||
|
"SaN": 128,
|
||||||
|
"SoV": 256,
|
||||||
|
"SoN": 512,
|
||||||
|
"Abbau": 1024,
|
||||||
|
};
|
||||||
|
|
||||||
|
function calculateBitValue() {
|
||||||
|
let totalBitValue = 0;
|
||||||
|
const formElements = document.forms['bitForm'].elements;
|
||||||
|
|
||||||
|
for (const element of formElements) {
|
||||||
|
if (element.type === 'checkbox' && element.checked) {
|
||||||
|
totalBitValue += TAGE[element.name];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
document.getElementById('result').textContent = `Gesamtbitwert: ${totalBitValue}`;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Loading…
Reference in new issue