limit digits in inputs fileds 5 digits minimum code example

Example 1: textbox should accept only numbers till 10 digit using angular

<input type="text" name="country_code" title="Error Message" pattern="[1-9]{1}[0-9]{9}">

Example 2: simple way to make a text field to accept numbers only with maximum number of length 13 digit and min 10

<input name="phoneNumber"
    oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);"
    type = "number"
    maxlength = "10"
 />

Example 3: contact text box accept only till 10 digit in html

<input type="text" maxlength="10" pattern="\d{10}" title="Please enter exactly 10 digits" />