Problem with javascript implementation in html

i have some problem with my code in atom editor. Why when i try to add some script code to my html, or even upload js file, my code change into grey color enter image description here

I will be very grateful for any advice