JSFiddle - React, Tailwind, and code Playground
HTML
<h1> Futzing Around With JavaScript </h1>
<div id="minimum"><\div>
JavaScript
/* the following function takes numbers and
returns the smaller of the two */
var minimum = $('#minimum');
function findSmallest(firstNum, secondNum){
if (firstNum == secondNum)
minimum.html("Numbers are Equivalent!");
else if (firstNum > secondNum)
minimum.html(secondNum + " is smaller than " + firstNum);
else
minimum.html(firstNum + " is smaller than " + secondNum);
}
findSmallest(13, 19);
/* this function serves much the same purpose -
in a more simplistic way */
/*var minimumTwo = $('#minimumTwo'); */
/* so both functions are working but I can't
get them to talk to the html correctly, I
tried to make a minimumTwo id with the above code
but no luck */
function findMin(num1, num2){
minimum.html(Math.min(num1, num2));
}
findMin(59, 7);