1

I have a expandable section which is a button (this is from a framework that I can not change). And inside this section, I got a clickable div. This is working on Chrome, IE, Safari, but not on Firefox.

<button onclick="alert('expand');" class="button">
   <div onclick="alert('Edit');" class="edit">Edit</div><br/>
</button>

https://jsfiddle.net/dLbkq6uy/1/

I can't fire the click event for the DIV inside this button on Firefox.

Alejandro
  • 5,834
  • 1
  • 19
  • 36
williamwmy
  • 321
  • 1
  • 4
  • 19
  • 2
    https://stackoverflow.com/questions/17253410/link-inside-a-button-not-working-in-firefox – deEr. May 04 '18 at 11:08

1 Answers1

2

In Firefox, the button itself steals events like mouse events and click of the child element. This means things inside buttons cannot be clicked. It is not considered a bug because it works exactly as designed.

Source

Please visit this also

Based on the above links the solution for Firefox is to change the button to some other element like div and manage the functionality and design accordingly.

Mamun
  • 66,969
  • 9
  • 47
  • 59