The lang attribute specifies which language is used to write the content of a web page. It is used to set the language for the whole text of the web page.
The difference between <html lang=”en’> and <html lang=”en-US’> is described below:
<html lang=”en’>
The <html lang=”en’> only specifies the language code of the page meaning en or English is used for all the text on the page.
Example:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>lang Attribute</title> <style> body{ text-align: center; } h1{ color: green; } </style> </head> <body> <h1>GeeksforGeeks</h1> <p>jQuery is an open source JavaScript library that simplifies the interactions between an HTML/CSS document, or more precisely the Document Object Model (DOM), and JavaScript. Elaborating the terms, jQuery simplifies HTML document traversing and manipulation, browser event handling, DOM animations, Ajax interactions, and cross-browser JavaScript development.</p> </body> </html> |
Output:

<html lang=”en-US’>
The <html lang=”en-US’> specifies the language code of the page followed by the country code that means US style of English language is used for all the text on the page.
<html lang=”en-GB’> which means the United Kingdom style of English
<html lang=”en-IN’> which means the Indian style of English
Example:
<!DOCTYPE html> <html lang="en-US"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>lang Attribute</title> <style> body{ text-align: center; } h1{ color: green; } </style> </head> <body> <h1>GeeksforGeeks</h1> <p>jQuery is an open source JavaScript library that simplifies the interactions between an HTML/CSS document, or more precisely the Document Object Model (DOM), and JavaScript. Elaborating the terms, jQuery simplifies HTML document traversing and manipulation, browser event handling, DOM animations, Ajax interactions, and cross-browser JavaScript development.</p> </body> </html> |
Output:

Recommended Posts:
- Difference between node.js require and ES6 import and export
- Difference Between DOS and Windows
- Difference Between Apache Kafka and Apache Flume
- Difference between Bootstrap and AngularJS
- Difference Between HTML and ASP
- Difference between ASP and ASP.NET
- Difference between Preemptive Priority based and Non-preemptive Priority based CPU scheduling algorithms
- What is the Difference between Website and Web Portal
- Difference between Web Scraping and Web Crawling
- Difference between TypeScript and JavaScript
- Difference between try-catch and if-else statements in PHP
- Difference between Algorithm, Pseudocode and Program
- Difference between Dropbox and OneDrive
- Difference between Applets and Servlets
- Difference between fundamental data types and derived data types
- Difference between Deterministic and Non-deterministic Algorithms
- Difference between HTML and HTML5
- What is the difference between parseInt() and Number()?
- Difference between Indirect and Implied Addressing Modes
- Difference between Hardwired and Micro-programmed Control Unit | Set 2
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


