i want to click a radio element automatically with js. Element selection is perfect because when i try to change it with innerHTML, it changes but click() does not work.
Code:
document.addEventListener("DOMContentLoaded", function(){
document.querySelector(".jet-radio-list__label").innerHTML = "Changed!"
document.querySelector(".jet-radio-list__label").click()
}
Tried Alternatives like:
document.querySelectorAll('input[type="radio"]').checked = true;
jet-radio-list__input
as well but no luck there as well – Zaeem Javed May 18 '21 at 11:28