JavaScript Introduction

In this post we’ll learn from Basic to advanced Java scripts.

  • JavaScript is the most popular programming language in the world.
  • JavaScript is the programming language of the web.
  • JavaScript is easy to learn.
  • This tutorial will teach you JavaScript from basic to advanced.

Why should you learn JavaScript?

JavaScript is one of 3 languages ​​every web developer should learn:

  1. HTML to define the content of the website
  2. CSS to define the layout of the website
  3. JavaScript to program the operation of websites

History of versions of JavaScript:

  • The Original JavaScript ES1 ES2 ES3 (1997-1999)
  • The First Main Revision ES5 (2009)
  • The Second Revision ES6 (2015)
  • All Yearly new Additions (2016 to 2022)

FAQ of JavaScript:

1. Is JavaScript Free?

Yes, JavaScript is free for everyone.

2. Where can I download JavaScript?

No download is required. JavaScript is already running in the browser on your computer, tablet, and smartphone.

3. How do I get JavaScript?

You don’t have to get or download JavaScript.

JavaScript Can Change HTML Content

You can first find id of you HTML object using getElementById() and then using innerHTML changes the element content to “Hello CodeConfig”.

document.getElementById("demo").innerHTML = "Hello CodeConfig";

JavaScript Can also Change Values of HTML Attribute

Let’s check one example in which JavaScript changes the value of the src (source) attribute of an <img> tag. Means image source will get change and you will observe new image.

<!DOCTYPE html>
<html>
<body>

<h2>Learn JavaScript </h2>

<p>JavaScript can  also change HTML attribute values</p>

<button onclick="document.getElementById('myImage').src='pic_bulbon.gif'">Turn ON/OFF</button>

<img id="myImage" src="pic_bulboff.gif" style="width:100px">

<button onclick="document.getElementById('myImage').src='pic_bulboff.gif'">Turn off the light</button>

</body>
</html>

Check more on JavaScript:

Leave a Reply

Your email address will not be published. Required fields are marked *