What is Vanilla Java script ?

 Hello Everyone ! The word Vanilla Java script little confuse right ? ohh, Don’t warry now we are going to understand that in clear manner.

Vanilla Java script is nothing but  a term used to refer a pure Java script code. written in its raw form , without any other Libraries

One of the primary advantage of vanilla Java script is its Simplicity It remains lightweight and easy to understand. This simplicity facilitates quicker learning and efficient practices

Direct Interaction with DOM(Document object model)

Vanilla Java script enables direct interaction with DOM of a web page. The direct interaction offers fine-grained control over the web page structure

Vanilla Java script Selectors

Selectors use to get element in DOM. some of them include getElementByTagName,  getElementById , getElementByClass  etc….

<!DOCTYPE html>
<html lang="en">
<head>
    <title>vanilla</title>
</head>
<body>
    <h2 >Welcome to vanilla Java Script</h2>
    <h2 id="add"></h2>
    <h2 id="sub"></h2>
    <h2 id="multiply"></h2>
   <h2 id="div"></h2>
    <script>
        let add= ` Addition of 5 and 5 is ${5+5}`;
        let sub =`Subtraction of 678 and 374 is   ${ 678-374}`;
        let multi=` Multiplication of 25 and 25 is ${25*25}`;
        let div= ` Division of 288 and 68 is ${28/468}`
        document.getElementById("add").innerHTML=add; 
         document.getElementById("sub").innerHTML=sub;
         document.getElementById("multiply").innerHTML=multi;
         document.getElementById("div").innerHTML=div;
    </script>
</body>
</html>

Output :

Welcome to vanilla Java Script

Addition of 5 and 5 is 10

Subtraction of 678 and 374 is 304

Multiplication of 25 and 25 is 625

Division of 288 and 68 is 0.05982905982905983

Many people find it hard to believe that number of Web sites that are using Vanilla Java script is much higher than websites that use Jquery .

Some of Big Websites that are currently running with Vanilla Java script

  • Amazon
  • LinkedIn
  • Google
  • Yahoo!
  • Facebook

Vanilla Java script creates Significant and Impactful Web Application .

 

 

Leave a Comment

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

Scroll to Top