Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • HTML Tutorial
  • HTML Exercises
  • HTML Tags
  • HTML Attributes
  • Global Attributes
  • Event Attributes
  • HTML Interview Questions
  • HTML DOM
  • DOM Audio/Video
  • HTML 5
  • HTML Examples
  • Color Picker
  • A to Z Guide
  • HTML Formatter
Open In App

HTML DOM documentMode Property

Last Updated : 02 Sep, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

The DOM documentMode property in HTML is an IE8 property that is used to detect the document mode used by the browser to render the current page. It returns a different number depending on the mode of the page in which it is being rendered because IE8 can render a page in various modes depending on the page's doctype plus the presence of certain HTML elements. This property returns certain values depending on which version of IE we are using.

  • If the page is running in IE5 then value displayed will be - 5
  • If the page is running in IE7 then value displayed will be - 7
  • If the page is running in IE8 then value displayed will be - 8

Note:

By default, the page is rendered in IE5 mode if !DOCTYPE is not specified.

Syntax:

document.documentMode

Example: In this example we displays a page with a title and headings, and uses JavaScript to show the current document mode of Internet Explorer by accessing the document.documentMode property and displaying its value.

html
<!DOCTYPE html> <html>  <head>     <title>DOM documentMode Property</title> </head>  <body style="text-align: center;">     <h1 style="color:green;">GeeksforGeeks</h1>     <h2>DOM documentMode Property</h2>     This document is displayed in IE     <span id="geek"></span> mode.     <script>         let docMode = document.documentMode;         document.getElementById("geek").innerHTML =             docMode;     </script> </body>  </html> 

Output:

documentmode

Supported Browsers: The documentMode property is only supported by Internet Explorer.


V

Vishal Chaudhary 2
Improve
Article Tags :
  • Web Technologies
  • HTML
  • CSS-Properties

Similar Reads

    CSS font-variant Property
    The font-variant property is used to convert all lowercase letters into uppercase letters. However, the converted upper letters appear too small compared to the original uppercase letters. Syntax: font-variant: normal|small-caps|initial; Default Value: normal Property Values:normal: It has a default
    2 min read
    CSS max-width Property
    The max-width property in CSS defines the maximum width an element can occupy, ensuring that it doesn't exceed a specified width. This property plays a crucial role in responsive design, allowing the content to adjust within a defined limit. It helps in creating flexible layouts that look great on v
    4 min read
    CSS flex-flow Property
    The flex-flow property is a sub-property of the flexible box layout module and also a shorthand property for flex-wrap and flex-direction. Note:The flex property is useless when the element is not a flexible item. Syntax:flex-flow: flex-direction flex-wrap;Values of flex-flow property:row nowrap: It
    8 min read
    CSS page-break-after Property
    The page-break-after property in CSS is used to add a page-break after the stated element. Similarly, page-break-before, page-break-after, and page-break-inside all three properties are instrumental in determining and hence defining how the resultant document would be when printed. Note: The page-br
    10 min read
    CSS max-height Property
    The max-height property in CSS is used to set the maximum height of an element. If the content of the element is larger than the specified maximum-height then the content will overflow otherwise it has no effect. If the content of the element is smaller then it has no effect. The height property val
    3 min read
    CSS min-height Property
    The min-height property in CSS is used to set the minimum height of an element. The min-height property is used when the content of the element is smaller than the min-height and if the content is larger than the min-height then it has no effect. This property ensures that the value of the height pr
    3 min read
    CSS margin-right Property
    The margin-right property in CSS is used to set the right margin of an element. It sets the margin area on the right side of the element. Negative values are also allowed. The default value of the margin-right property is zero. Syntax:margin-right: length|auto|initial|inherit;Property Value:length:
    3 min read
    CSS border-color Property
    The CSS border-color property allows developers to define the color of an element's border, enhancing the visual design of a webpage. It works in conjunction with the border property to provide control over the appearance of borders using various color values like-named colors, hex codes, or RGB val
    5 min read
    CSS box-sizing Property
    The CSS box-sizing property controls how an element's size is calculated. When using the border-box model, the padding and border are included in the element’s total width and height, making it easier to manage the layout.Syntaxbox-sizing: content-box | border-box;Property ValuesHere is a descriptio
    3 min read
    CSS margin-left Property
    The margin-left property in CSS is used to set the width of the margin on the left of the desired element. Negative values of this property are allowed.A positive value is used when it is desired that the margin is farther away from its neighbors.A negative value is used when it is desired that the
    3 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences