List of questions
Related questions
Question 114 - Certified JavaScript Developer I discussion
Refer to the code below:
<html lang="en">
<table onclick="console.log(Table log');">
<tr id="row1">
<td>Click me!</td>
</tr>
<table>
<script> function printMessage(event) { console.log('Row log');
}
Let elem = document.getElementById('row1'); elem.addEventListener('click', printMessage, false);
</script>
</html>
Which code change should be made for the console to log only Row log when 'Click me! ' is clicked?
A.
Add.event.stopPropagation(); to window.onLoad event handler.
B.
Add event.stopPropagation(); to printMessage function.
C.
Add event.removeEventListener(); to window.onLoad event handler.
D.
Add event.removeEventListener(); toprintMessage function.
Your answer:
0 comments
Sorted by
Leave a comment first