+ 2

How do I make a HTML file?

I would like to practice JavaScript on a computer, but I don't know how?

16th May 2017, 9:03 PM
KingCodesalot
KingCodesalot - avatar
5 Réponses
+ 5
1) open notepad 2) write some html code + javascript 3) save file with an extension ".html" eg. something.html 4) open file in browser.
16th May 2017, 9:12 PM
ifl
ifl - avatar
+ 5
Save the following content as index.html file. <!DOCTYPE html> <html> <head> <title>Html with Javascript</title> </head> <body> <h1>Sample Title</h1> <p>Lorem ipsum</p> <script> // Javascscript code here alert("Javascript run."); </script> </body> </html> Double click the file to open it on your default browser. To test your Javascript, just place Javascript code inside script tag. You can output your results using alert() or console.log() (view the results from browser developer console). More to learn: Learn how to interact Javascript with HTML elements (DOM) using document.getElementById, document.getElementsByClassNme, document.getElementsByTagName. and its member functions.
17th May 2017, 1:23 AM
Calviղ
Calviղ - avatar
+ 3
To add to @ifl open any browser of your choice i.e Chrome. Click on menu and open developer tools and click on the console tab. There you can practice your JavaScript.
16th May 2017, 9:51 PM
Benneth Yankey
Benneth Yankey - avatar
+ 2
console.log("using the console \n is faster than refreshing the page after saved the code ")
16th May 2017, 10:31 PM
Abdel
Abdel - avatar
0
you can opening Notpad and type anything. in last save to html
31st May 2017, 9:33 PM
Majid Taghipour
Majid Taghipour - avatar