<button id="btnHello">Say Hello
</button>
button{
 padding: 10px 20px; 
 border-radius: 25px;
 border: solid 1px green;
}

const button = document.getElementById('btnHello');

button.addEventListener('click', sayHello);

function sayHello() {
  alert('Hello');
}
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.