Skip to content

Instantly share code, notes, and snippets.

@glenkusuma
Last active June 3, 2024 16:54
Show Gist options
  • Save glenkusuma/9b9a9940cffa33a5e7ba0eb3e22e5725 to your computer and use it in GitHub Desktop.
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à✨
// 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();
@omanfathurrahman
Copy link

Sangad-sangad usefull

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment