Which code change should be made for the console to log only Row log when ‘Click me! ’ is clicked?
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.
Answer: B
Latest JavaScript Developer I Dumps Valid Version with 144 Q&As
Latest And Valid Q&A | Instant Download | Once Fail, Full Refund
Subscribe
Login
0 Comments
Inline Feedbacks
View all comments