Basic Math Challenge


                            
        document.getElementById("Least-btn").addEventListener("click", function () {
            Least()
        })
        function Least() {
            let input1 = document.getElementById("input1").value;
            let input2 = document.getElementById("input2").value;
            let input3 = document.getElementById("input3").value;
            let input4 = document.getElementById("input4").value;
            let input5 = document.getElementById("input5").value;
            let spanEl = document.getElementById("result1");
            spanEl.innerHTML = `${Math.min(input1, input2, input3, input4, input5)}`;
        }
        document.getElementById("Greatest-btn").addEventListener("click", function () {
            Greatest()
        })
        function Greatest() {
            let input6 = document.getElementById("input6").value;
            let input7 = document.getElementById("input7").value;
            let input8 = document.getElementById("input8").value;
            let input9 = document.getElementById("input9").value;
            let input10 = document.getElementById("input10").value;
            let spanEl = document.getElementById("result2");
            spanEl.innerHTML = `${Math.max(input6, input7, input8, input9, input10)}`;
        }
        document.getElementById("Mean-btn").addEventListener("click", function () {
            Mean()
        })
        function Mean() {
            let input11 = document.getElementById("input11").value;
            let input12 = document.getElementById("input12").value;
            let input13 = document.getElementById("input13").value;
            let input14 = document.getElementById("input14").value;
            let input15 = document.getElementById("input15").value;
            let result = ((+input11 + +input12 + +input13 + +input14 + +input15) / 5);
            let spanEl = document.getElementById("result3");
            spanEl.innerHTML = `${result}`;
        }
        document.getElementById("Sum-btn").addEventListener("click", function () {
            Sum()
        })
        function Sum() {
            let input16 = document.getElementById("input16").value;
            let input17 = document.getElementById("input17").value;
            let input18 = document.getElementById("input18").value;
            let input19 = document.getElementById("input19").value;
            let input20 = document.getElementById("input20").value;
            let result = +input16 + +input17 + +input18 + +input19 + +input20;
            let spanEl = document.getElementById("result4");
            spanEl.innerHTML = `${result}`;
        }
        document.getElementById("Product-btn").addEventListener("click", function () {
            Product()
        })
        function Product() {
            let input21 = document.getElementById("input21").value;
            let input22 = document.getElementById("input22").value;
            let input23 = document.getElementById("input23").value;
            let input24 = document.getElementById("input24").value;
            let input25 = document.getElementById("input25").value;
            let result = +input21 * +input22 * +input23 * +input24 * +input25;
            let spanEl = document.getElementById("result5");
            spanEl.innerHTML = `${result}`;
        }
        function ClearAll() {
            document.getElementById("input1").value = "";
            document.getElementById("input2").value = "";
            document.getElementById("input3").value = "";
            document.getElementById("input4").value = "";
            document.getElementById("input5").value = "";
            document.getElementById("input6").value = "";
            document.getElementById("input7").value = "";
            document.getElementById("input8").value = "";
            document.getElementById("input9").value = "";
            document.getElementById("input10").value = "";
            document.getElementById("input11").value = "";
            document.getElementById("input12").value = "";
            document.getElementById("input13").value = "";
            document.getElementById("input14").value = "";
            document.getElementById("input15").value = "";
            document.getElementById("input16").value = "";
            document.getElementById("input17").value = "";
            document.getElementById("input18").value = "";
            document.getElementById("input19").value = "";
            document.getElementById("input20").value = "";
            document.getElementById("input21").value = "";
            document.getElementById("input22").value = "";
            document.getElementById("input23").value = "";
            document.getElementById("input24").value = "";
            document.getElementById("input25").value = "";

            document.getElementById("result1").innerText = "";
            document.getElementById("result2").innerText = "";
            document.getElementById("result3").innerText = "";
            document.getElementById("result4").innerText = "";
            document.getElementById("result5").innerText = "";
        }