Listen to class during page loading

Asked

Viewed 15 times

1

I need to create a function or script that when loading the page detects which elements have a specific class and execute the defined programming... in case it would hide the content...

only that the problem is being make it perform it in real time.. so the element is created..

I’m trying to do this with javascript but it’s worth php tbm.. if anyone can help me...

var hid = document.querySelectorAll('.esconde')
for (var i = 0; i <= hid.length; i++) {
    hid[i].innerHTML = " ";
}

This code does what I want only after loading the page.. I need it to happen during loading

  • You’d better do it with CSS! .esconde {display: none;} So the page never shows these elements.

  • can not do this way pq breaks the layout

  • What’s the difference to do with CSS and how you search "I need it to happen during charging"?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.