To send an event named upvote {{ post_title }}
when the element with class upvote-button
is clicked:
<script>
window.onload = function() {
var button = document.querySelector('.upvote-button');
if (button) {
button.addEventListener('click', function(event) {
cabin.event("kudos");
});
}
};
</script>
(ref)
More @srs bsns (lol)