skip to Main Content

Javascript – How can I select HTML elements which are rendered after DOM

I want to select OKBTN let main = document.querySelector("#main"); let okBtn = document.querySelector("#ok"); function myAlert(title,msg,icon){ let card = ""; card += `<div class="card"> <img src="${icon}.jpg"> <h1>${title}</h1> <p>${msg}</p> <button id="ok">OK</button> </div>`; main.innerHTML = card; } okBtn.addEventListener("click", function(){ main.style.display = "none"; });…

VIEW QUESTION

Javascript – Can't access shadowRoot

I want to pass a captcha on website https://sirus.one/#play and I need to set the solved captcha value in textarea.g-recaptcha-response -> div.innerText. TextArea has shadowRoot where website saving the response of recaptcha. I tried to access shadowRoot like that: document.querySelector("textarea.g-recaptcha-response").shadowRoot,…

VIEW QUESTION
Back To Top
Search