Exit 70-480 Programming in HTML5 with JavaScript and CSS3
Question 1 of 5
0% complete
Q1 Single choice

You are developing a customer web form that includes the following HTML input field.

<input id="txtValue"/>

If a customer enters a value in the input field, then it must be a numeric value.

You need to add validation to the input field.

Which HTML should you use?

  • A

    <input id="txtValue" type-"text" pattern="/#" />

  • B

    <input id="txtValue" type="number" />

  • C

    <input id="txtVa!ue" type="integer" />

  • D

    <input id="txtValue" type="text" required="required"/>

Previous Next