Widget:YieldCalc: Difference between revisions

From Ara: History Untold Wiki
No edit summary
Tag: Manual revert
No edit summary
Line 11: Line 11:
<p id="foodYield"></p>
<p id="foodYield"></p>


<form id="foodYieldForm" method="get">
<form id="foodYieldForm">
   <input type="number" id="cityProd" placeholder="62"><br />
   <input type="number" id="cityProd" placeholder="62"><br />
   <button type="submit">Calculate</button>
   <button type="submit">Calculate</button>
Line 19: Line 19:


let foodYieldForm = document.getElementById("foodYieldForm");
let foodYieldForm = document.getElementById("foodYieldForm");
foodYieldForm.addEventListener("submit", (e) => {
 
   e.preventDefault();
foodYieldForm.addEventListener("submit", (event) => {
   event.preventDefault();
  sendData();
});
});



Revision as of 22:10, 24 October 2024

This widget is used to display and calculate the yield with the values submitted by the user.

Usage: ‎{{#Widget:YieldCalc}}