Use a unique identifier for each text input field and get their values ββin your JavaScript method using getElementById("[YourDefinedId]") and compare them with each other and show alter.
HTML
<input type="text" class="selector" id="first" value="new"> <input type="text" class="selector" id="second" value="old"> <input type="text" class="selector" id="third" value="newest"> <input type="text" class="selector" id="fourth" value="oldest"> <input type="text" class="selector" id="fifth" value="older">
Javascript
function compareValues(){ var first = getElementById("first").value; var second = getElementById("second").value; var third = getElementById("third").value; var fourth = getElementById("fourth").value; var fifth = getElementById("fifth").value;
source share