Mundrisoft Example

event.preventDefault() vs event.stopPropagation() vs return false

event.preventDefault(): Click square with prevent Default.

Click me

event.stopPropagation(): Click inside first square normally, Click inside square with stopped propagation.

Without e.stopPropagation Click me
With e.stopPropagation Click me

return false : Click inside first square normally, Click inside square with return false. return false stop both preventDefault and stopPropagation.

Without return false Click me
With return false Click me