(function() {
var checkboxes = document.querySelectorAll('input[type="checkbox"]');
var checkedLabels = [];
checkboxes.forEach(function(checkbox) {
if (checkbox.checked) {
var label = checkbox.nextElementSibling;
if (label && label.innerText) {
checkedLabels.push(label.innerText);
}
}
});
// Copy the checked labels to the clipboard
var textToCopy = checkedLabels.join('\n');
var tempInput = document.createElement("textarea");
document.body.appendChild(tempInput);
tempInput.value = textToCopy;
tempInput.select();
document.execCommand("copy");
document.body.removeChild(tempInput);
console.log("Labels of checked checkboxes copied to clipboard.");
})();
miércoles, 24 de mayo de 2023
List of labels whose checkmark is checked. Copy them in clipboard
Checkbox marked as string in a text label - DevTools in Chrome Snippet
(function() {
var checkboxes = document.querySelectorAll('input[type="checkbox"]');
checkboxes.forEach(function(checkbox) {
var label = checkbox.nextElementSibling;
if (label && label.innerText.includes(")*_")) {
checkbox.checked = true;
}
});
})();
sábado, 13 de mayo de 2023
jueves, 11 de mayo de 2023
Suscribirse a:
Entradas (Atom)