<!DOCTYPE html>
<html>
<head>
<style>
input:out-of-range
{
border: 2px solid red;
}
</style>
</head>
<body>
<input type="number" min="5" max="10" value="17">
<p>If the user select a number out of range then the border will become red.</p>
</body>
</html>