1

I am brand new to programming and javascript, and recently I tried practicing javascript with a website I created and whenever I declare any change in the DOM the website loses its css.

Example:

When I declare:

let "bodyTitle = document.getElementById('body1');

bodyTitle.textContent = 'Random TextContent';

I get the text changed but the CSS doesn't follow.

Did I just make faulty website structure or terrible css? I am still extremely new so I kind of threw things together to get my website.

Any help would be great!

closed as off-topic by Aakash Maurya, sssreddy, MHeld, Gaurravs, Asad Refai Nov 28 '18 at 9:47

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Programming questions not specific to SharePoint are off-topic here, but can be asked on Stack Overflow." – sssreddy, MHeld, Gaurravs, Asad Refai
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Hey Ahmed, two things: Your missing code examples which make it hard to see what your doing wrong and this question would likely be better posted to SO (stackoverflow.com) as it doesn't seem related to SharePoint – Roland Nov 28 '18 at 2:25
  • thannks roland, i'll go check it out! – Ahmed G. Nov 28 '18 at 4:48