Well, Js is used to make your website more dynamic and functional. var x= "Aditi" that you quoted is similar to declaring variables in any other programming language. When relating this with HTML and CSS, whenever the user gives an input, be it a click or submitting value inside text box, you need to store the input first before performing a function on it, right? Here Js variables come into effect. These variables can store input from user or you can initialise variables on your own as well. Initialising is just for convenience sake. Suppose you have to use "Vineeth" many times in you code. Then instead of writing it many times we can just declare var a= "Vineeth" and then use a instead. Example:- Input :- making an online calculator; You need to take input from user and then return the result after performing the calculation.