exam questions

Exam 98-382 All Questions

View all questions & answers for the 98-382 exam

Exam 98-382 topic 1 question 8 discussion

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

DRAG DROP -
You are using JavaScript to create a calculator.
You create the following HTML. Line numbers are included for reference only.

You must create a function named add() that adds the values in the a and b input elements and displays the result in the result input element.
You define the following function in JavaScript:
function add() {
}
You need to complete the body of the function.
Which three code segments should you use to develop the solution? To answer, move the appropriate code segments from the list of code segments to the answer area and arrange them in the correct order.
NOTE: Each correct selection is worth one point.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
References: https://www.w3schools.com/jsref/jsref_eval.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
jp_1
Highly Voted 4 years, 6 months ago
var a=eval(document.getElementById("a").value); var b=eval(document.getElementById("b").value); document.getElementById("result").value=a+b;
upvoted 18 times
...
KSinha
Highly Voted 5 years, 5 months ago
The first 3 options would be correct in my opinion
upvoted 14 times
...
robin11
Most Recent 3 years ago
it seems that the given sollution is wrong isnt it? the 3rd line i mean.. according to the 'missing/used' snippets on the right..
upvoted 1 times
...
Sathya235
3 years, 5 months ago
var a = eval(document.getElementById("a").value); var b = eval(document.getElementById("b").value); document.getElementById("result").value = a + b;
upvoted 2 times
...
kiese78
3 years, 10 months ago
var a=eval(document.getElementById("a").value); var b=eval(document.getElementById("b").value); document.getElementById("result").value=a+b;
upvoted 2 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 ...