In this tutorial post we will be running our first JavaScript program which is a basic Hello World program where we ill simple print Hello World(or any other text) on the browser.
The 2 softwares needed to start of with JavaScript are –
Text Editor : I will be using Visual Studio Code Text Editor which is highly recommended by many specially for Javascript, however you can use any other text editor like Notepad++ or Sublime text etc.
Browser : Of course a browser is needed to load the HTML document and run the JavaScript so I will be using Google Chrome browser. You can use any browser of your choice as most modern browsers have JavaScript enabled by default.
There are 2 ways to include JavaScript in your HTML Document –
Embedding JavaScript in the same HTML document
Using External JavaScript file and linking it in your HTML document.
1. Embedding JS in HTML document –
As you can see in the code below, we are embedding JS code using the script tag of HTML. Usually when the JavaScript code is small it is directly embedded in the HTML document, however, it is not recommended to embed large sized JS code directly in the HTML document as the code becomes un-organized.
2. External JavaScript File –
As you can see below there are 2 file – one the actual HTML document and other a separate external javascript file (demo.js). This demo.js file is linked in the HTML document using the script tag with the use of the attribute src as shown in the code below. When the javascript code is large, it is highly recommended to use a separate external file to keep the HTML doc and the JS code organized.
For Program code and more resources checkout this article – https://simplesnippets.tech/first-hello-world-program-in-javascript/
Video by – Tanmay Sakpal
Simple Snippets Channel link – https://www.youtube.com/simplesnippets
Original source
29 responses to “#3 JavaScript Tutorial | First Hello World Program”
Why the videos are not upladed in 1080P
Really great work..Thanks a ton…!!!
But i'm stuck at one point, please help me with that. As U have told, we can use html tags inside javascript.
eg: document.write("<h1>heading tag1</h1>");
How this works.? I have even tried to use form tag and all it worked. So, in that case can we use any html tag inside javascript..?
Browser simply runs that javascript, and since it understand html it simply parses html and gives the desired output. Is that right..please do confirm..
1:46 hahaha
awesome explanation ๐ keep up the good work.
Good explaining
Sir can we use brackets software for JavaScript?
Hello sir,thank u for sharing the JD videos and also u have to tell about text editor like visual studio code,how we can add the files in vs code,pls make a video for me.
You deserve my friend.
Thank you Simple Snippets and Telusko Learnings….
Hello sir can u complete the data structure playlist?
Great Explanation..Waiting for the next one sir..Thank You…
thank you #Telusko your channel good than university congratulation
Great work Tanmay,
Btw can i use brackets as my text editor as I have got used to it
Excellent Tanma
Good Job brother, Learning JS anew and hope to catch up with you. waiting for you next video. Thanks
liked it
Well explained!
But it looks awkward when you code at the right side but the output is shown on the left side.
If you have not already recorded all the videos for this tutorial series/playlist then, please, I request, by now, keep the VS Code window opened at the left hand side and the browser window at the right. It will help maintaining our natural spirit of thinking and understanding with more ease and comfort. Its a matter of psychology.
Note: If viewers dislike this comment don't change your way, but if they like then you should think, otherwise it's your choice whether you like my suggestion or not. ๐
You have a great art of explanation.Thanks
Thanks brother
Hi Sir,
Thank you so much for this wonderful session.I m having one doubt after importing the external JavaScript file the remaining lines which are written next in the HTML file are not get printed in the browser. I don't know why it is not printed .Is this the expected behavior??.Can you please clarify this doubt??
@telusuko learning:- hi Sir, do we have any java library for compressing video's…?
Amazing Lecture โค๐โ
thanks .. awesome video and the way of explaining is very good
Hey Tanmay peace โฎ๏ธ
Hi sir……why don't we use ide's for JS.
thank you very much sir for this video amazing explanation
NYC one sir โบ๏ธ
Liked the video Again.๐
Thank you tanmay sir.. โ๏ธโ๏ธ
Can you please tell me the screen recording tool name?