<script>
function lettersOnly(input) {
var regex = /[^a-z]/gi;
input.value = input.value.replace(regex, "");
}
</script>
<input type="tel" name="Contact number" pattern="\d{8}" title='8 digits telephone number' placeholder=" Contact Number" id="contactno"
onkeyup="lettersOnly(this)"><br>
The input section is part of a form and I want to make sure only numbers can be typed into the contact number input.