user2630764 user2630764 - 2 months ago 8
CSS Question

Making a div nonclicable

I have a div and inside I have two clickable labels.
For some reason, the empty space within the div other than label is also getting clicked.

Is there any way to disable click inside A div other than for two labels?

Answer

Make the div not clickable and label clickable

div{
  pointer-events:none;
}
label{
  pointer-events:all;
}