Changing text color with JavaScript
What is wrong with my JS that it won’t change the color to blue? https://code.sololearn.com/WLbw0Jc4cAUf/?ref=app
\n
\n\nThere was get eleme t by id inside \"quotes\" and scrip tag was before the paragraf. Now is fixed.","upvoteCount":2},{"@type":"Answer","text":"Watch the text change onclick https://code.sololearn.com/Wfl7z7583TFW/?ref=app","upvoteCount":1},{"@type":"Answer","text":"Actually, it’s better to write scripts in a separate js file, your code there will look like this:\nonload=()=>{\n var els = document.getElementById ('change_color');\n els.style.color = 'blue';\n}","upvoteCount":1},{"@type":"Answer","text":"David I have always found putting it in a function is the easiest way rather onload or by button","upvoteCount":1},{"@type":"Answer","text":"so i have to put it in a function?","upvoteCount":0}]} }
What is wrong with my JS that it won’t change the color to blue? https://code.sololearn.com/WLbw0Jc4cAUf/?ref=app