Javascript Function Test All Values are Equal
Javascript Function Test All Values are Equal - Test if All Values in an Array of Elements is Equal, for Example Value of All Textboxes is the Same or Equal
Home
Short:
function checkAllInputsMatch(elems) { if (elems.length == 0) { return; } let firstValue = elems[0].value.trim(), allMatch = true; elems.forEach(input => { if (input.value !== firstValue) { allMatch = false; } }); return(allMatch); }
source code home