HTML 5 supports pattern and number type:
<input type="number" name="country_code" pattern="^[(99)(98)](\d*)$" title="number starting with 99 or 98"></input>
Note: The pattern attribute of the input tag is not supported in Internet Explorer 9 and earlier versions, or in Safari.