List of questions
Related questions
Question 94 - Certified JavaScript Developer I discussion
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
B.
Outer messageInner message
C.
Inner messageOuter message
D.
Inner message
Your answer:
0 comments
Sorted by
Leave a comment first