What does the onclick attribute do?

It defines what happens when visitors click a buttonIt takes visitors to another website

The onclick attribute defines what happens when a button is clicked.