You know that variables are essential in programming. So do you know how to create variables in HTML, which is not a programming language, to improve

How to define variables in HTML and how to use variables [var tag + JavaScript]

submited by
Style Pass
2021-05-28 11:36:02

You know that variables are essential in programming. So do you know how to create variables in HTML, which is not a programming language, to improve the efficiency of calculations?

First is the method of variable declaration using the var tag. The var (reading: bar) tag is an abbreviation for "variable" and indicates that the value enclosed by the var tag is a variable.

The var tag is not a tag to change the appearance, but it seems to be displayed in italics depending on the browser.

If you actually use the var tag, you can see that the enclosed value is displayed in italics. This is the default value set in your browser, so you can rewrite it by specifying the var tag in CSS.

JavaScript and HTML are interdependent. Therefore, JavaScript is realized by writing it in HTML using script tags or writing JavaScript in an external file and linking it.

Leave a Comment