+ 8

How to link JavaScript code inside HTML code (<script></script>) on SoloLearn, when adding code

17th Jul 2018, 1:11 PM
Freddie
Freddie - avatar
5 odpowiedzi
+ 4
<script src="javascript_file.js">
18th Jul 2018, 10:28 AM
Sasanka Kosuru
Sasanka Kosuru - avatar
+ 11
You can use Css and Js section in Web Code Playground..
17th Jul 2018, 1:27 PM
Muhd Khairul Amirin
Muhd Khairul Amirin - avatar
+ 5
You can a) write code straight into the JS section of the Code Playground, or b) use the src attribute of the <script> tag, like this: <!DOCTYPE html> <html> <head> <title>My Code</title> <script src = “externalJavaScriptFile.js”></script> </head> <body> ... </body> </html> Note that, if the src attribute is present, the the content must be empty. Hope that helps!
18th Jul 2018, 6:10 AM
Rowsej
Rowsej - avatar
+ 4
You don't need to link to the JS and the CSS code in the SL code playground.
17th Jul 2018, 1:14 PM
Satyam
+ 4
to link JavaScript code inside HTML code (<script></script>) by this :" please look below " " NOT in sololearn " <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="first sololearn webpage.css"> <!-- script tag can be set inside <head> or <body> tags --> <title> </title> <style> </style> </head> <body bgcolor="#789ABC"> <script src="first sololearn webpage.js"></script> But in sololearn you just compleate typing html,css,and javascript then click run. It will run like magic without linking them inside each other... I hope you understand what i typed ...
17th Jul 2018, 1:54 PM
Shevar Sansiro
Shevar Sansiro - avatar