I'm messing around with vanilla JavaScript and I noticed that when styling a document with js in the DOM the styles are inline. Is there a way to style a style sheet with javascript used on the DOM or is styling with Javascript bad practice? I was thinking it might have some uses when parts of a website change with user interaction, but I'm guessing the same thing can be accomplished with css pseudo classes. To reiterate my question can you use javascript to style a stylesheet in the DOM or is it just inline and bad practice?
body.style.backgroundColor= "blue";