You are developing a customer web form that includes the following HTML.
<input id=”txtValue” type=”text” />
A customer must enter a valid agein the text box prior to submitting the form.
You need to add validation to the control. Which code segment should you use?
Explanation:
.val()
Get the current value of the first element in the set of matched elements or set the value of every matched
element.
.text()
Get the combined text contents of each element in the set of matched elements, including their descendants, or
set the text contents of the matched elements.
RegExexplained