- It is widely used for web development to create dynamic and interactive web pages.
- It is easily written inside HTML in script tag or in a seperate file and imported in HTML file.
- it give html web pages a dynamic behaviour.
- React js
- Angular js
- react native etc.
- dynamic and interactive web pages
- creating pop-ups,
- animating elements
- manipulating the Document Object Model (DOM) etc.
type − This attribute indicate the scripting language used. its an optional attribute.
You can use any IDE . I prefer Visual Studio Code.
- download Visual Studio Code from this link : https://code.visualstudio.com/
- once downloaded, Open Visual Studio Code.
- Click File in the top left corner.
- Click New File and Enter name as “index.html”. ( note: filetype of new file should be .html extension)
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
document.getElementById("myDiv").innerHTML = "Hello World !!";
6. To run, Right click & click on “open with browser”.
7. You will see, output as: Hello World !!
both statement is same .
eg. var x=10
4. support both single line and block comment.
// single line comment.
/* block comment: