Microsoft
98-382 · Question #5
98-382 Question #5: Real Exam Question with Answer & Explanation
Sign in or unlock 98-382 to reveal the answer and full explanation for question #5. The question stem and answer options stay visible for context.
Question
You are creating a web page that allows customers to choose how hot their spice is. If they choose spicy, a warning should be displayed. You create the following form. Line numbers are included for reference only.
01 <form name = "orderForm" action = "#" method = "post">
02 <select name = "heatIndex" required>
03 <option>Mild</option>
04 <option>Medium</option>
05 <option>Spicy</option>
06 </select>
07 <button onclick = "checkWarning()">Order</button>
08 </form>
You create the following JavaScript code to display the warning.
09 function checkWarning() {
10 var option = document.forms.orderForm.heatIndex;
11 if (option == "Spicy") {
12 alert("Spicy food: Good Luck!");
13 }
14 }
When you choose spicy and click Order, the warning fails to display. You need to solve this problem.
Unlock 98-382 to see the answer
You've previewed enough free 98-382 questions. Unlock 98-382 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.