mirror of
https://github.com/jlelse/GoBlog
synced 2024-06-18 05:25:00 +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()
|
|
})
|
|
})
|
|
|
|
})() |