JSFiddle - React, Tailwind, and code Playground
HTML
<form id="someForm">
<input type="text" id="importantInput" />
<button type="button" id="buttonWithType">
Type
</button>
<button>
No Type
</button>
</form>
CSS
body {
background-color: lightseagreen;
}
button {
border: 1px solid #333;
background-color: #999;
color: #000;
}
button:active {
background-color: #111;
}
input {
border: 1px solid #333;
background-color: #999;
}
JavaScript
document.getElementById('buttonWithType').addEventListener('click', function() {
document.getElementById('importantInput').value = 'anime is for manchildren';
});
document.getElementById('someForm').addEventListener('submit', function(e) {
alert('nigger');
e.preventDefault();
});