You develop an HTML5 webpage. You have the following HTML markup: <input type="text" id="username" /> You need to prevent users from entering specific characters into the username field. What should you do?
A.
Using the keyup event, add an anonymous function that returns true when a specific character keycode value is determined.
B.
Using the change event, add an anonymous function that returns true when a specific character keycode value is determined.
C.
Using the keydown event, add an anonymous function that returns false when a specific character keycode value is determined.
D.
Using the change event, add an anonymous function that returns false when a specific character keycode value is determined.
Suggested Answer:B🗳️
The change event is fired for <input>, <select>, and <textarea> elements when a change to the element's value is committed by the user. Use the change event and an anonymous function to detect illegal specific characters in the input.
That would be incorrect, The keyup/keydown event is sent to an element when the user releases a key on the keyboard. It can be attached to any element, but the event is only sent to the element that has the focus, And the change event is not necessarily fired for each alteration to an element's value.
Meaning it can't be B or D the answer should be A.
This section is not available anymore. Please use the main Exam Page.70-480 Exam Questions
Log in to ExamTopics
Sign in:
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.
RubyH
Highly Voted 5 years, 1 month agoDreamchaser1980
Most Recent 4 years, 4 months agonlb
4 years, 8 months agoNicolaas
4 years, 5 months agoruif90
4 years, 9 months agoShiras
5 years, 4 months agobdb1993
5 years, 5 months agoMushi
6 years agomogec39
5 years, 7 months agomogec39
5 years, 7 months ago