An item inside a button does not fire a click event in Firefox.

This script works in Chrome, but not in Firefox. Does anyone know why?

Here is the markup:

<button> <span onclick="alert('yoo')">hey</span> </button> 
+3
source share
1 answer

This is by definition, see 4.10.8 Button element

Content Model:
Content phrases, but there must be a non-interactive child content.

+1
source

Source: https://habr.com/ru/post/1234812/


All Articles