mirror of
https://github.com/jlelse/GoBlog
synced 2024-07-06 01:22:59 +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()
|
||
|
})
|
||
|
})
|
||
|
|
||
|
})()
|