Is it possible to not load an element in the DOM of an HTML page with CSS or Javascript ?
I have a <div>
that I want to load only when the resolution is a smartphone one.
Just to do a display: none;
while I don't want it doesn't work because a script (iScroll) is linked to the <div>
.
I really have to not load it in the DOM (or to delete it from the DOM when I load my page).
I believe that I can do it using removeChild()
. But is there a way in CSS ?