0

Can anyone explain me how to put js in web.

I dont know how to conect js with html and css.

8th Dec 2019, 8:23 AM
Arydev
Arydev - avatar
6 Answers
8th Dec 2019, 8:36 AM
Bahha┣
Bahha┣ - avatar
+ 1
There is two way to add JS in the web: 1. Internal 2. External 1. Internal:- In this, the JavaScript can be put into the script tag. Example: <script> document.getElementById("demo").innerHTML = "Hello JavaScript!"; </script> 2. External:- In this, create the separate JavaScript file then link that file in the html. Example: Let we have the file "hello.js" Now link this into the html <html> <body> <script src="hello.js"></script> </body> </html>
8th Dec 2019, 8:48 AM
Raju Ram Sau
Raju Ram Sau - avatar
+ 1
in SoloLearn create a new web code and everything is set up. there will be a tab for html, css, and js. write your html in html and javascript in js you don't have to add javascript inside html tab. unless you need something like jquery or p5js...
8th Dec 2019, 8:57 AM
Bahha┣
Bahha┣ - avatar
+ 1
by using their id or class. if you have a button i. e <button id ="ok" > </button> in js write : var btn = document.getElementById("ok") have you learned anything about javascript?
8th Dec 2019, 9:04 AM
Bahha┣
Bahha┣ - avatar
0
I wont to use it in sololearn
8th Dec 2019, 8:49 AM
Arydev
Arydev - avatar
0
But how to conect buttons and forms to js
8th Dec 2019, 8:59 AM
Arydev
Arydev - avatar