Saturday, 29 May 2021

JavaScript for Beginners PART-2

 JavaScript for Beginners PART-2


While we want to use any other code in HTML. we need to use the tag <script>. In this script lag, you are going to code your javascript code.

Here I am using a sublime text editor which is a famous text editor for programmers. I recommended working with sublime text so you can make programming easy.



For defining the javascript language, we need to use define inside the script tag as:
<script language="javascript" type="text/javascript">.

And now we are going to code our first program that is "hello world" by using the method document.write. This method is used to print any data type. In python we use "print", In java, we use "System.out.print", In C++ we use "court" etc., like this we use "document.write" to print a line in javascript.

Now, you need to do the ToDo2:
Step1: Install any programming text editor i.e, Sublime text editor
Step2: Write a basic HTML code. 
Step3: Inside the body tag, display "hello world/Your Name" in the webpage by using javascript.
Step4: Get verified with me on Instagram.

Output:


Learn some of the concepts in javascript by using this below book 



Latest
Next Post

post written by:

0 Comments: