You are given the code below, which is currently not behaving as intended.
When clicking on the parent <div>
console will show the "Parent is clicked" message (as expected).
However, when clicking the child <div>
console will show both the "Parent is clicked" and "Child is clicked" messages.
Your assignment is to adjust the code so that only "Child is clicked" message appears when clicking the child div
IZAZOV:
Dobijaš kod iznad, koji se trenutno ne ponaša kako se očekivalo:
Kada kliknete na nadređeni <div>
, videćete poruku „Parent is clicked“ (kao što se očekivalo).
Ali kada kliknete na podređeni <div>
, videćete obe “Parent is clicked” i “Child is clicked” poruke.
Tvoj je zadatak da prilagodiš kod tako da vidiš samo poruku “Child is clicked” kada se klikne na podređeni <div>
.