ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 94 - Certified JavaScript Developer I discussion

Report
Export

Refer to the following code:

<html lang="en">

<body>

<div onclick = "console.log('Outer message') ;">

<button id ="myButton">CLick me<button>

</div>

</body>

<script>

function displayMessage(ev) {

ev.stopPropagation();

console.log('Inner message.');

}

const elem = document.getElementById('myButton');

elem.addEventListener('click' , displayMessage);

</script>

</html> What will the console show when the button is clicked?

A.
Outer message
Answers
A.
Outer message
B.
Outer messageInner message
Answers
B.
Outer messageInner message
C.
Inner messageOuter message
Answers
C.
Inner messageOuter message
D.
Inner message
Answers
D.
Inner message
Suggested answer: D
asked 23/09/2024
Abbas Jabbari
42 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first