use this expression
var RegExpression = /^[a-zA-Z\s]*$/;
Update: 27-April-2023
function validate(){
const regEx1 = /[^a-zA-Z\s]+/;
input.value = input.value.replace(regEx1, '');
}
<input id="input" type="text" onkeyup="return validate();">