JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" value="1" />
<input type="text" value="2" />
<input type="text" value="4" />
<input type="text" value="3" />
<input id="getMax" type="button" value="Get Max" />
JavaScript
$("#getMax").click(function () {
var values = $.map($("input:text"), function(el, index) { return parseInt($(el).val()); });
alert(Math.max.apply(null, values));
});