<input type="text" value="100">
<input type="text" value="150">
<input type="text" value="110">
<script>
var max = 100;
for (var i = 0; i < document.querySelectorAll("input").length; i++) {
var numb = Number(document.querySelectorAll("input")[i].value);
if (numb > max) {
max = numb;
alert(max);
}
var selector = 'input[value="'+max+'"]';
}
document.querySelector(selector).id = "someid";
</script>