Widget:YieldCalc: Difference between revisions
No edit summary |
No edit summary |
||
Line 6: | Line 6: | ||
<includeonly> | <includeonly> | ||
<form id="foodYieldForm"> | <form id="foodYieldForm"> | ||
<input type="number" id="cityProd" placeholder="62"><br /> | <input type="number" id="cityProd" placeholder="62"><br /> | ||
<input type="submit" value="Calculate" onkeyup=" | <input type="submit" value="Calculate" onkeyup="yieldScript()"> | ||
</form> | </form> | ||
Line 17: | Line 15: | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
/* Yield Calculator */ | /* Yield Calculator */ | ||
function | function yieldScript(){ | ||
let a = document.getElementById("cityProd").value; /* City Production */ | let a = document.getElementById("cityProd").value; /* City Production */ | ||
let b = 4; /* Yield(Apples) of the region */ | let b = 4; /* Yield(Apples) of the region */ |
Revision as of 22:47, 24 October 2024
This widget is used to display and calculate the yield with the values submitted by the user.
Usage: {{#Widget:YieldCalc}}