Widget:RimCalc: Difference between revisions
Jump to navigation
Jump to search
Matt Pijoan (talk | contribs) No edit summary |
Matt Pijoan (talk | contribs) No edit summary |
||
Line 2: | Line 2: | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
$(document).ready(function(){ | $(document).ready(function(){ | ||
$("# | $("#submit").click(function(){ | ||
var temp = 0; | |||
temp = (140 - parseInt($("#input2").html()) * parseInt($("#input1").html())); | |||
console.log(temp); | |||
temp = temp / (parseInt($("#input3").html()) * 72) | |||
console.log(temp); | |||
if ($("#input4").is(':checked')) { | |||
temp = temp * .85; | |||
console.log(temp); | |||
$("#output").html(temp); | $("#output").html(temp); | ||
} | |||
}); | }); | ||
}); | }); | ||
</script> | </script> | ||
<input type="text" id="input1" /><br /> | Weight: <input type="text" id="input1" /><br /> | ||
<input type="text" id="input2" /><br /> | Age: <input type="text" id="input2" /><br /> | ||
<input type="text" id="input3" /><br /> | Serum: <input type="text" id="input3" /><br /> | ||
<input type=" | Female? <input type="checkbox" id="input4" /><br /> | ||
<input type=" | <input type="button" value="Calc" /> | ||
<div id="output"></div> | |||
<div id="output"> | |||
</includeonly> | </includeonly> |