<!--
Oh sure, they work just fine with the mouse, but navigate to each button with the keyboard and hit ENTER.
-->
<button onclick="alert('Hi, I am a native button!')">
Click me
</button>
<div role="button" tabindex="0" onclick="alert('Hi, I am a non-native button!')">
Click me
</div>
body {
display: flex;
flex-direction: row;
justify-content: space-around;
padding-top: 50px;
background: #f2f2f2;
}
button,
div {
font-size: 2rem;
padding: .5em;
background: #ccc;
border: 1px solid #ccc;
border-radius: 4px;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.