I am working on the chrome extension for auto jobs apply on indeed and encountering this issue. I'm encountering an issue where, upon entering a number in the input via bot using JavaScript, the text seems to be putted in the text. However, when I subsequently click a continue button on the page, the selected input seems vanished Is there a way to ensure that the selected input remains in its checked state even after interacting with other elements on the page, such as continue buttons? this is source code that I am using currently. I was tried to solve it various ways but always upon clicking the continue button radio input vanished just in search of a solution though which clicking on the continue button input remain same so I can go further
const input = document.querySelector('input[type="number"][value=""]');
if (input) {
// Dispatch a keydown event with the key code for "1" (49)
const event = new KeyboardEvent('keydown', {
keyCode: 49,
bubbles: true,
cancelable: true,
key: "1",
charCode: 49,
});
input.focus(); // Ensure input field is focused
input.dispatchEvent(event); // Dispatch the keydown event
console.log('Filled input field with value: 1');
} else {
console.log('Input field not found or already filled.');
}