document.querySelectorAll('.button')[0].addEventListener('click', function(event) { console.log('Button clicked'); });
<a href="#" class="button">Play</a>
.button { width: 100px; height: 50px; line-height: 50px; position: absolute; left: 50px; top: 50px; color: #FFF; text-decoration: none; background: linear-gradient(#1879BD 50%, #084D79 50%); text-align: center; font-size: 15px; font-family: sans-serif; } .button:hover { background: linear-gradient(#678834 50%, #093905 50%); } .button:active { background: linear-gradient(#EB7723 50%, #A80000 50%); }