ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 97 - Certified JavaScript Developer I discussion

Report
Export

Given the following code:

document.body.addEventListener(' click ', (event) => {

if (/* CODE REPLACEMENT HERE */) {

console.log('button clicked!');

)

});

Which replacement for the conditional statement on line 02 allows a developer to correctly determine that a button on page is clicked?

A.
Event.clicked
Answers
A.
Event.clicked
B.
e.nodeTarget ==this
Answers
B.
e.nodeTarget ==this
C.
event.target.nodeName == 'BUTTON'
Answers
C.
event.target.nodeName == 'BUTTON'
D.
button.addEventListener('click')
Answers
D.
button.addEventListener('click')
Suggested answer: C
asked 23/09/2024
Jarrad Payne
36 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first