<input type="text" id="name" name="name" required
minlength="4" maxlength="8" size="10">
//Use the code below to set min and max characters for an input
//grabbing element from the DOM
const username = document.getElementById('username');
function checkLength(input, min, max) {
if(input.value.length < min)
{//below can be applied to a field, etc
console.log(`${input.id} must be at least ${min} characters`)
}
else if(input.value.length > max){
console.log(`${input.id} must be less than ${max} characters`)
}
}
//call function
checkLength(username, 3, 15)