S
S
Sergey Lyalin2020-08-06 10:29:59
JavaScript
Sergey Lyalin, 2020-08-06 10:29:59

How to get selector generated after page load?

The whole script runs in

window.onload = onloadPage()
    function onloadPage() {
//код
}


After loading, there is a page and I can get to the necessary selectors through document.querySelector().
However, if I write a selector that will be generated after some user action, then the script does not detect it.

In another piece of code, I found that I had used it before.
document.getElementsByClassName(

But is it possible to somehow get by with querySelector ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Lyalin, 2020-08-06
@Spokik

Yes, it seemed strange to me. In fact, my getElements fired on events, which in turn assume the presence of the necessary selectors. I will think

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question