<!DOCTYPE html>
<html>
<body>

<input type="text" id="myInput" onblur="checkInput()">

<script>
function checkInput() {
  var input = document.getElementById("myInput").value;
  if (input < 10) {
    document.getElementById("myInput").style.borderColor = "red";
  } else {
    document.getElementById("myInput").style.borderColor = "black";
  }
}
</script>

</body>
</html>