mirror of
https://github.com/jlelse/GoBlog
synced 2024-07-02 03:37:34 +00:00
10 lines
329 B
JavaScript
10 lines
329 B
JavaScript
(function () {
|
|
|
|
// Make checkboxes with class '.autosubmit' submit form automatically
|
|
Array.from(document.querySelectorAll("form input[type='checkbox'].autosubmit")).forEach(element => {
|
|
element.addEventListener('change', event => {
|
|
event.currentTarget.closest('form').submit()
|
|
})
|
|
})
|
|
|
|
})() |