repz,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
#abracadabra {
background-color: #00FF00;
}
</style>
</head>
<body>
<div>
<input type="text" value=200>
<input type="text" value=100>
<input type="text" value=500>
<input type="text" value=100>
</div>
<script>
window.addEventListener("DOMContentLoaded", function() {
var a = document.querySelectorAll("div input");
[].reduce.call(a, function(a, b) {
return 0 <= a.value - b.value ? a : b
}, a[0]).id = "abracadabra"
});
</script>
</body>
</html>