<input type="checkbox" @click="somefunction">
Some function would live in the methods object.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I want to trigger a function when a checkbox is checked and is unchecked... what can i do about this? something like v-on:click...
@greenroofcorp well yeah, you can use the click event or the change event. It would look like:
<input type="checkbox" @click="checkboxToggle">
Now just define that checkboxToggle method in your Vue instance and it should be triggered each time you click the checkbox. You can replace the click event with change event if you want.
Please or to participate in this conversation.