web/assets/js/_commons/checkbox.js
Cotes Chung d61446fafc Create a more beautiful checkbox
The browser's default checkbox is too ugly, especially in dark mode
2020-12-14 02:13:31 +08:00

12 lines
378 B
JavaScript

/*
* Create a more beautiful checkbox
*/
$(function() {
/* hide bullet of checkbox item */
$("li.task-list-item:has(input)").attr("hide-bullet", "");
/* create checked checkbox */
$("input[type=checkbox][checked=checked]").before("<span checked></span>");
/* create normal checkbox */
$("input[type=checkbox]:not([checked=checked])").before("<span></span>");
});