Last active
June 3, 2024 16:54
-
-
Save glenkusuma/9b9a9940cffa33a5e7ba0eb3e22e5725 to your computer and use it in GitHub Desktop.
igrasias edom script - feelin lazy pressin all the input form in igracias edom? just copy and paste this javascript into your dev tool console! let the javascript magic do it's thing and voilà✨
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// igrasias edom script version 03/06/24 | |
// Constants for the labels | |
const SATISFIED_LABELS = new Set(["Ya", "Sangat puas"]); | |
// Function to click radio buttons based on labels | |
const clickRadioButtons = () => { | |
const optElements = document.getElementsByClassName("opt"); | |
Array.from(optElements).forEach(optElement => { | |
const label = optElement.parentElement.nextElementSibling.innerText; | |
if (SATISFIED_LABELS.has(label)) { | |
optElement.click(); | |
} | |
}); | |
}; | |
// Function to set textarea values to an invisible space | |
const setTextareasToInvisibleSpace = () => { | |
document.querySelectorAll("textarea").forEach(textarea => { | |
textarea.value = "ㅤ"; // invisible space | |
}); | |
}; | |
// Function to click the appropriate submit button | |
const clickSubmitButton = () => { | |
const submitButton = document.querySelector(".floatL4") || document.querySelector(".floatL3"); | |
if (submitButton) submitButton.click(); | |
}; | |
// Execute functions | |
clickRadioButtons(); | |
setTextareasToInvisibleSpace(); | |
clickSubmitButton(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sangad-sangad usefull