JSFiddle - React, Tailwind, and code Playground

by TJ VanToll

HTML

<p>Place focus into the textbox and press Enter. In IE a click event will be triggered on the <code>&lt;button&gt;</code>, even though no <code>&lt;form&gt;</code> is present.</p>

<p>The workaround is to add <code>type="button"</code> to the <code>&lt;button&gt;</code>.</p>

<input>
<button>Button</button>

JavaScript

document.querySelector( "button" ).addEventListener( "click", function() {
    alert( "click" );
});