exam questions

Exam 70-480 All Questions

View all questions & answers for the 70-480 exam

Exam 70-480 topic 1 question 2 discussion

Actual exam question from Microsoft's 70-480
Question #: 2
Topic #: 1
[All 70-480 Questions]

You are developing a customer web form that includes the following HTML.
<input id="txtValue" type="text" />
A customer must enter a valid age in the text box prior to submitting the form.
You need to add validation to the control.
Which code segment should you use?

  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️
.val

Return value -
A string containing the value of the element, or an array of strings if the element can have multiple values

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
goodlink
4 years, 6 months ago
A and C uses text() function wich is not relevant for an input element B does not use any regular expression to validate the content, D contains an instruction to validate an email input and it's the correct answer.
upvoted 2 times
...
dibirov
4 years, 7 months ago
Why not A?
upvoted 1 times
...
krzysiekprzybylak
5 years, 3 months ago
Correct is B in my opinion could somebody explain that if I am wrong ?
upvoted 2 times
nelaed
4 years, 11 months ago
It needs to be a number, but wre have a text input so there is a need for some kind of verification like regex.
upvoted 1 times
...
...
ichbin
5 years, 3 months ago
Why not B?
upvoted 3 times
krzysiekprzybylak
5 years, 3 months ago
You can write string in field and should be only valid year or number but D is not correct as well because you can put 0 or very big number
upvoted 1 times
...
...
Ridvan
5 years, 4 months ago
Syntax are not proper in D. It's not a valid answer.
upvoted 2 times
Anette
4 years, 10 months ago
Why its not correct? I agree D is correct
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...