Below is my Html sample code in which there is a single input field which accepts numbers as well as alphabet.
I need to call function according to the values entered by the user i.e if user enter pure 10 dgits phone number then call function number() if user enters email call function email() else mix then error.
I need only one input element for both phone number and email.
Html
<div>
<input type="text" id="contact"/>
<button onClick()="???">Submit</button>
</div>
<script>
function number(){
// call when input value is a number;
}
function email() {
// call this when input value is an email;
}
</script>