botbot
botbot

Reputation: 7359

Disable Clicks on Div Overlay, But Allow Children Clicks

I have a div that contains some text inputs. I would like those text inputs to clicked and receive basic mouse events, but I would like to disable the containing div. Is there a way to do this? The div has a higher z-index than some other elements, it is absolutely positioned, and is not allowing me to click elements underneath it. Thanks!

Upvotes: 2

Views: 5348

Answers (1)

Paul Fleming
Paul Fleming

Reputation: 24526

You cannot click elements that are below (depth) another element. Give the actionable input elements higher z-indexes (and abs/rel positioning) than the covering div.

Upvotes: 2

Related Questions