PrepAway - Latest Free Exam Questions & Answers

You need to modify the webpage to invoke the JavaScript function named someEvent()

You troubleshoot a webpage that contains the following HTML markup: (Line numbers are
included for reference only.)

The webpage also contains the following JavaScript function named someEvent() that is
declared in the HEAD section of the HTML:
Function someEvent() {
Alert(‘someEvent fired!’);
}
The JavaScript function named someEvent() must run only when the user clicks the DIV
element, not the INPUT elements.
You need to modify the webpage to invoke the JavaScript function named someEvent().
What should you do? (Each correct answer presents a complete solution. Choose two.)

PrepAway - Latest Free Exam Questions & Answers

A.
Option A

B.
Option B

C.
Option C

D.
Option D

4 Comments on “You need to modify the webpage to invoke the JavaScript function named someEvent()

  1. someonelikeyou says:

    1. stop event propagation (A)
    2. distinguish direct click from propagated one (C): here el === target only if div was clicked directly, becouse otherwise target would be one of input elements.

    Two others:
    in B span would propagate event to div, because span is most “dumb” element in html
    in D div does not have even onclick defined on it




    0



    0

Leave a Reply