How should you complete the relevant code?

HOTSPOT
You develop an HTML5 webpage that contains the following markup and code:

You have the following requirements:
Display a message if users select the first OPTION element, and then submit the form.
Do not display an alert message if users select any other OPTION element, and then submit the form.
You need to implement the madeSelection() function.
How should you complete the relevant code? (To answer, select the appropriate code segment from
each drop-down list in the answer area.)

HOTSPOT
You develop an HTML5 webpage that contains the following markup and code:

You have the following requirements:
Display a message if users select the first OPTION element, and then submit the form.
Do not display an alert message if users select any other OPTION element, and then submit the form.
You need to implement the madeSelection() function.
How should you complete the relevant code? (To answer, select the appropriate code segment from
each drop-down list in the answer area.)

Answer:



Leave a Reply 14

Your email address will not be published. Required fields are marked *


d

d

??? element.text === “…” should be the correct option. these options don’t have a value, you get the
text

maldivequio

maldivequio

is element.text

M

M

I’ve searched in all websites that offer answers to Exam 70-480 and all of them agree with the answer given here:
if (element.value === “Please Choose”) {

hus

hus

element.text is undefined.
The correct answer is element.value

Lab

Lab

Remember we are looking at the Selects value if we would been looking at an option it could have been both but we’re not..

The correct answer is
element.value

wq

wq

Has anyone notice “Display a message if users select the first OPTION element, and then submit the form.” Where is the message ? We only have focus ? and should we submit the form when it’s value is “Please Choose”?

R.C

R.C

I have the same question. Should it “return ture” after “element.focus” ?

Damien

Damien

Directly after the if statement there is a line that says:

alert(message);

This displays the message when the “Please Choose” value is chosen.

Al

Al

The answer given works perfectly. element.text does not work.

Sven

Sven

Why element.focus() ?? Is there any reason to do this? The form is submitted so you can’t correct it…

nguyen

nguyen

The question may be wrong, if you think about how it should work then element.focus() and cancel submitting will make sense.

Azadeh

Azadeh

This is a select So should be value, I sat the exam once before and I can tell you there are a lot of questions in regards to difference between val an text! (the trick is you should know For input elements text is invalid and you should use val)

raul

raul

it’s element.value
because its an input dom element.
instead por example text
you should choise .text

johanna

johanna

Can you please update this questions,I nearly failed yesterday because there are so many new questions i.e Targets