This repository has been archived on 2020-10-16. You can view files and clone it, but cannot push or open issues or pull requests.
counter/frontend/components/counter-up-btn/counter-up-btn.js

14 lines
322 B
JavaScript
Raw Normal View History

import "./counter-up-btn.pcss";
import { sendIncrement } from "client/counter";
window.addEventListener("DOMContentLoaded", () => {
const btn = document.querySelector(".counter-up-btn");
if (btn) {
btn.addEventListener("click", (event) => {
event.preventDefault();
sendIncrement(-1);
});
}
});