user2630764 user2630764 - 1 year ago 73
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 Source

Make the div not clickable and label clickable

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