I\'m trying to accommodate users without JavaScript. (By the way, is it worth the effort nowadays?)
In one HTML file I\'d like part of it execute if scripts are on
This makes the content inside the div inaccessible without JS but with JS it adds the content into the div with JS and you can also do that with the CSS. To change the CSS add:
document.querySelector('style').innerHTML = 'div{}';
document.querySelector('div, #div').innerHTML = 'Div';