<html>
<body>

<input id="numberbox" type='number' max='100'>
<input type='text' maxlength='2' pattern='^[0-9]$'>

<script>
$('#numberbox').keyup(function(){
  if ($(this).val() < 100){
    alert("No numbers above 100");
    $(this).val('100');
  }
});
</script>
<input type="text" name="textWeight" id="txtWeight" maxlength="5" onkeyup="this.value = minmax(this.value, 0, 100)"/>


</script>

</body>
</html>
