Where is write the javascript code in html page

Hi, 

in this article we talk about "Where is write the javascript code in html page". This is important topic for you because javascript code will be different location in the html page.

Javascript code must be inserted between <script> and <script> tags.

for Example 

<script>
document.getElementById("txtName").innerHTML = "my name is Cengiz Atilla";
</script>

We can write the javascript code in head tag or body tag. Just we have to  be careful the javascript code will be in script tags.

We can write the Javascript code in html or external js file. If we write an external js file, we need to refer to the external js file on the html page when we want to use it.

for example 

testJavascriptCode.js 

function myFunction() {
   document.getElementById("txtName").innerHTML = "My name is Cengiz ATİLLA";
}

test.html

<script src="testJavascriptCode.js"></script>
<head>
<title> Where is write the javascript code in html page </title>
</head>
<body>
Hello World
</body>

in this article we learned where can we write javascript code in html page.it is important because we usually write javascript code in html page.

 

Why we have to learn Javascript ?

Hi , 

In this article we talk about "Why we have to learn Javascript". 

We have to learn javascript because we develop web technology. Javascript is one of the 3 languages all web developer have to learn. 

If you want to be a developer, you have to learn these technologies

  1. HTML
  2. CSS
  3. Bootstrap
  4. Javascript
  5. for .net developers Asp.net MVC or MVC Core

You will be learn easy javascript because it is not difficult language. When we learn javascript then i will learn faster angularjs and nodejs.

Most popular question : which program i need to learn javascript.
Answer : Notepad 

We will learn JavaScript easily in this article line.

see you soon...