exam questions

Exam 98-382 All Questions

View all questions & answers for the 98-382 exam

Exam 98-382 topic 1 question 11 discussion

Actual exam question from Microsoft's 98-382
Question #: 11
Topic #: 1
[All 98-382 Questions]

DRAG DROP -
You are creating a web page that tests a user's ability to accurately type text. The validation should be case-insensitive.
How should you complete the code? To answer, drag appropriate functions to the correct locations. Each function may be used once, more than once, or not at all.
You may need to drag the split bar between panes or scroll to view content.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
References: https://www.w3schools.com/jsref/prop_text_value.asp

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
KSinha
Highly Voted 5 years, 6 months ago
The answers for the last 2 text boxes would be toLowerCase()?
upvoted 18 times
LGeldenh
3 years, 8 months ago
In the question it says that the validation should be case-insensitive. So the answer they gave us should be correct
upvoted 3 times
...
...
Ciupaz
Highly Voted 4 years, 8 months ago
Yes, the answers should be "toLowerCase()".
upvoted 8 times
...
d31a
Most Recent 2 years, 4 months ago
The correct answer is: .value .innerHTML .toLowerCase() .toLowerCase() I tested this. To validate for case-sensitive, you just pass the values : if( input == text ) for case-insensitive, you translate both values to lowercase. This is the correct solution: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>replit</title> <link href="style.css" rel="stylesheet" type="text/css" /> <script>function validate() { var input = document.getElementById("tester").value; var text = document.getElementById("userText").innerHTML; if( input.toLowerCase() == text.toLowerCase() ) { alert("Success"); } } </script> </head> <body> <p id ="userText">Test</p> <input type="input" id="tester" /> <button onclick="validate()">Validate</button> </body> </html>
upvoted 2 times
...
Sathya235
3 years, 5 months ago
.value .innerHTML .toLowerCase .toLowerCase The solution given in the Reveal solution is wrong
upvoted 2 times
...
PallaviSos
3 years, 12 months ago
Correct answers : value innerHTML toLowerCase toLowerCase
upvoted 5 times
...
CodeMan
4 years, 6 months ago
The answers should not be 'toLowerCase()', as the solution requires the input to be case-sensitive.But, the last two boxes should not exist, as those vars are already set to value and innerHTML. I tested in code myself, and with this solution- any user input evaluates to a success.
upvoted 4 times
JoelChuca
4 years, 3 months ago
No man, the requirement says "The validation should be case-insensitive". so toLowerCase() is correct
upvoted 9 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 ...