This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
playground:playground [2019/07/10 13:26] fachet created |
playground:playground [2019/01/06 09:29] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ~~NOCACHE~~ | + | ====== PlayGround ====== |
- | ====== Kabellängen ====== | + | |
- | <html> | + | |
- | <!-- präsentiert von kostenlose-javascripts.de --> | + | |
- | <script type='text/javascript'> <!-- | + | |
- | function berechnen() { | + | |
- | var bmi; | + | |
- | var weight = document.bmiform.gewicht.value; | + | |
- | var height = document.bmiform.groesse.value; | + | |
- | if (weight < 10 || weight > 200) { alert("Falsches Gewicht.nBitte Daten erneut eingeben"); return null; } | + | |
- | if (height < 50 || height > 250) { alert("Falsche Grösse.nBitte Daten erneut eingeben"); return null; } | + | |
- | bmi = Math.round(weight / (Math.pow((height/100),2))); | + | |
- | output = "Ihr BMI beträgt " + bmi + ".\n"; | + | |
- | if (bmi < 18) output += "Sie haben starkes Untergewicht."; | + | |
- | if (bmi == 18) output += "Sie haben deutliches Untergewicht."; | + | |
- | if (bmi == 19) output += "Sie haben leichtes Untergewicht."; | + | |
- | if (bmi >= 20 && bmi <= 24) output += "Dies liegt im idealen Bereich."; | + | |
- | if (bmi >= 25 && bmi <= 29) output += "Sie haben leichtes bis mässiges Übergewicht."; | + | |
- | if (bmi >= 30 && bmi <= 39) output += "Sie haben deutliches Übergewicht."; | + | |
- | if (bmi >= 40) output += "Sie haben sehr starkes Übergewicht."; | + | |
- | alert(output); | + | |
- | } | + | |
- | //--> | + | |
- | </script> | + | |
- | <form name="bmiform"> | + | |
- | <input type="text" name="groesse" /> | + | |
- | Größe in cm<br /> | + | |
- | <input type="text" name="gewicht" /> | + | |
- | Gewicht in kg<br /> | + | |
- | <input type="button" name="submit" value="berechnen" onclick="berechnen();"> | + | |
- | <br /> | + | |
- | </form> | + | |
- | <br /> | + | |
- | </html> | + | |