Using javascript and html together in sololearn

Heyy I've this doubt, if you can please help. When I write document.getElementById() inside a script tag in the html file, I'm getting the desired output, but when I write the same in javascript file, I'm not getting the output , how do I link the Js file to html file in sololearn code playground ? Like there's no specific name to the Js file, which I can write inside href of a script tag, so how do I do it on sololearn playground? Help

5/27/2019 6:18:29 PM

Prakhar Parashar

1 Answer

New Answer


JavaScript, HTML and CSS are automaticaly linked within the sololearn's code playground. Maybe your problem is elsewhere. Also, remember that you should use the 'src' attribute for scripts, not 'href'