Why does this code removes the div child when click happens on the right side of div element but not when clicking below [SOLVED | SoloLearn: Learn to code for FREE!

+2

Why does this code removes the div child when click happens on the right side of div element but not when clicking below [SOLVED

https://code.sololearn.com/WTxjYVqQY3bQ/?ref=app

6/2/2020 7:20:03 PM

Abhay

5 Answers

New Answer

+1

Abhay Yes. But add border to body and look at result.

+2

I think you are right but using background-color for body tag applies to whole page,so anywhere click happens should remove the div element why only at the right side of it !

+2

Leonid Selivanov thks

+1

Because at the bottom where there is no gradient even the body tag has ended I think.

0

Your style contents: #remove{ height:100px; ...