How to define a variable in HTML5 ? Last Updated : 18 Jan, 2024 Comments Improve Suggest changes Like Article Like Report The <var> tag is used to define variables in HTML and specify mathematical equations or computer programs. The content inside the tag is usually displayed in italics in most browsers. Note: This tag is not deprecated but using CSS can create more dynamic effects. The <var> tag also supports the Global Attributes and Event Attributes in HTML. Syntax:<var> Contents... </var>Example: In this example, we will see how to create a variable in HTML5. html <!DOCTYPE html> <html> <head> <title> How to define a variable in HTML5? </title> <style> body { text-align: center; } .gfg { font-size: 40px; font-weight: bold; color: green; } .geeks { font-size: 25px; font-weight: bold; } </style> </head> <body> <div class="gfg">GeeksForGeeks</div> <h2> <var> HTML5: How to define a variable? </var> </h2> <var>GeeksforGeeks Variable</var> </body> </html> Output: Supported Browsers are listed below:Google Chrome 1Edge 12Firefox 1Opera 15Safari 4 Comment More infoAdvertise with us Next Article How to define a variable in HTML5 ? M manaschhabra2 Follow Improve Article Tags : Web Technologies HTML HTML-Questions Similar Reads How to define an embedded object in HTML5 ? In this article, you will learn how to define an embedded object by using the <object> element in the document. It is used to display multimedia objects like audios, videos, images, PDFs, and Flash in web pages. The element is also used for displaying any other webpage on an HTML page. This ta 1 min read How to define a client-side script in HTML5 ? To define a client-side script in HTML5, we can do <script> tag or adding external script file by src attribute to the HTML file. <script> tag contains the JavaScript to be added for the client-side scripting. Syntax: <script> // JavaScript goes here console.log('GeeksforGeeks'); 1 min read How to define a form for user input using HTML5 ? In this article, we will learn how to create a form in a webpage by using the <form> tag. This tag is used to create form for user input. Also there are many elements which are used within form tag. Syntax: <form> Form Content... </form> Example: The following code snippet demonstr 1 min read HTML| DOM Variable Object The DOM Variable Object is used to represent HTML <var> element. The var element is accessed by getElementById(). Syntax: var element = document.getElementById("ID"); Where âidâ is the ID assigned to the âvarâ tag. Example-1: HTML <!DOCTYPE html> <html> <head> <title>HT 2 min read How to Add JavaScript in HTML Document? To add JavaScript in HTML document, several methods can be used. These methods include embedding JavaScript directly within the HTML file or linking an external JavaScript file.Inline JavaScriptYou can write JavaScript code directly inside the HTML element using the onclick, onmouseover, or other ev 3 min read Like