Sandbox
From Hidden Mickey Wiki
| Item | Done | Time |
|---|---|---|
| Example task 1 | ||
| Example task 2 | ||
| Example task 3 |
<script> (function () {
'use strict';
function formatTime(d) {
return d.toLocaleTimeString('en-US', {
hour: 'numeric',
minute: '2-digit',
second: '2-digit'
});
}
function findTsBox(cb) {
var tr = cb.closest('tr');
return tr ? tr.querySelector('.mw-ts-box') : null;
}
document.addEventListener('change', function (ev) {
var cb = ev.target;
if (cb.matches && cb.matches('.mw-checkbox-ts')) {
var tsBox = findTsBox(cb);
if (tsBox) tsBox.textContent = cb.checked ? formatTime(new Date()) : ;
}
}, false);
})(); </script>