<div id="parent">
<div>
<button onClick={() => console.log("a")}>a</button>
</div>
<button onClick={() => console.log("b")}>b</button>
<button onClick={() => console.log("c")}>c</button>
</div>
As above, it has a parent element and a child element. In this situation, is it possible to prevent the child element from being clicked through the parent element, or to prevent the child element's onclick event from being fired?
In the above situation, console.log should not be generated no matter which button is clicked.
There is a way to cover the parent element by adding another element, but I'm curious how to prevent it through only the parent element.