> For the complete documentation index, see [llms.txt](https://docs.wproofreader.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wproofreader.com/v6.12.0/integrations/how-tos/how-to-add-on-click-listener-to-the-badge.md).

# How to add on-click listener to the badge?

If you need to capture an onclick event, when your end-users click on the WProofreader badge button, you can do the following:

```javascript
var buttons = document.querySelectorAll('.wsc-badge__button');

buttons.forEach(function(button) {
    button.addEventListener('click', function(e) {
        // Do what you want here on badge button click event.
    });
});
```
