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 Style transitionProperty Property

Last Updated : 16 Jun, 2023
Comments
Improve
Suggest changes
Like Article
Like
Report

The Style transitionProperty property in HTML DOM used to set the name of the CSS property for the transition effect. It can occur when a user hover over an element. It returns the transitionProperty property of an element.

Syntax: 

  • It returns the transitionProperty property.  
object.style.transitionProperty
  • It is used to set the transitionProperty property.  
object.style.transitionProperty = "none | all | property |                                     initial | inherit"

Property Values: 

  • none: The transition effect will not apply to any element.
  • all: All elements will get a transition effect. It is a default value.
  • property: It is used to specify a comma-separated value for CSS property names for the transition effect.
  • initial: It sets the transitionProperty property to its default value.
  • inherit: This property is inherited from its parent element.

Return Value: It returns a string representing the transitionProperty property of an element.
Example1: 

html
<!DOCTYPE html> <html>  <head>     <title>DOM Style transitionProperty Property </title>     <style>         #gfg {             border: 3px solid blue;             background-color: green;             width: 100px;             height: 50px;             -webkit-transition: all 2s;             /* for safari 3.1 to 6.0 */             transition: all 2s;         }          #gfg:hover {             background-color: green;             width: 200px;             height: 100px;         }     </style> </head>  <body>      <center>         <h1 style="color:green;">             GeeksForGeeks         </h1>         <h2>             DOM Style transitionProperty Property         </h2>          <div id="gfg" style="color:white">             A Computer science portal for geeks         </div>         <br>         <button type="button"                  onclick="geeks()">             Click         </button>          <script>             function geeks() {                 document.getElementById(                     "gfg").style.transitionProperty = "all";                  //  for safari 3.1 to 6.0                  document.getElementById(                     "gfg").style.WebkitTransitionProperty = "all";             }         </script>     </center> </body>  </html> 

Output: 

 

Example 2: 

html
<!DOCTYPE html> <html>  <head>     <title>DOM Style transitionProperty Property </title>     <style>         #gfg {             border: 3px solid blue;             background-color: green;             width: 100px;             height: 50px;             -webkit-transition: all 2s;             /* for safari */                         transition: all 2s;         }          #gfg:hover {             background-color: green;             width: 200px;             height: 100px;         }     </style> </head>  <body>      <center>         <h1 style="color:green;">             GeeksForGeeks         </h1>         <h2>             DOM Style transitionProperty Property          </h2>          <div id="gfg" style="color:white">             A Computer science portal for geeks         </div>         <br>         <button type="button"                  onclick="geeks()">             Click         </button>          <script>             function geeks() {                  document.getElementById(                     "gfg").style.transitionProperty =                     "width, height";                  document.getElementById(                     "gfg").style.WebkitTransitionProperty =                     "width, height";             }         </script>     </center> </body>  </html> 

Output: 

 

Supported Browsers: The browser supported by DOM Style transitionProperty property are listed below: 

  • Google Chrome 26.0 and above
  • Edge 12.0 and above
  • Internet Explorer 10.0 and above
  • Firefox 16.0 and above
  • Opera 12.1 and above
  • Apple Safari 9 and above

B

bestharadhakrishna
Improve
Article Tags :
  • Technical Scripter
  • Web Technologies
  • HTML
  • Web technologies
  • HTML-DOM
  • HTML-Property

Similar Reads

    HTML | DOM Window closed Property
    The Window closed property in HTML DOM is used to return a value that indicates whether the referred window is closed or not. Syntax: window.close() Return Value: A Boolean value, true if window is closed otherwise false. Example: HTML <!DOCTYPE html> <html> <head> <title> HT
    1 min read
    HTML | DOM Style textAlignLast Property
    The Style textAlignLast property in HTML DOM is used to set the alignment of the last line of the text. Syntax: Return the textAlignLast property: object.style.textAlignLast Set the textAlignLast property: object.style.textAlignLast = "auto | left | right | center | justify | start | end | initial |
    2 min read
    HTML | DOM TouchEvent
    When a user touches a touch-based device the resulted events are handled by TouchEvent Object. The touch events consist of three types of interfaces i.e. Touch, TouchEvent and TouchList. The single contact point events on a touch-sensitive device are handled by the Touch interface. The events which
    2 min read
    HTML | DOM Storage Event
    The Storage Event in HTML DOM is used to make change in the storage area in the context of another document. When there is modification in the storage area of the window, a storage event is sent to that window. Syntax: window.addEventListener("storage", script) Example: html <!DOCTYPE html>
    1 min read
    HTML | DOM PageTransitionEvent
    The PageTrasitionEvent occurs during the time a document is being loaded or unloaded. Syntax: PageTransitionEvent.persisted Property Values: persisted: Returns boolean value whether the webpage was cached or not. Return Value: This property returns True if the document is loaded from a cache or not
    1 min read
    HTML DOM Style display Property
    The HTML DOM Style display property is used to set or return the display type of an element. It is similar to the visibility property, which displays or hides the element. With a slight difference in display: none, hiding the entire element, while visibility: hidden meaning only the contents of the
    3 min read
    HTML | DOM Input Submit Object
    The Input Submit object in HTML DOM represents the HTML <input> element with type = "submit" attribute. Syntax: It creates an Input Submit Object.document.createElement("INPUT")It is used to access an Input Submit Object.document.getElementById("id") Property Values: autofocus: It sets or retu
    3 min read
    HTML | DOM Input URL Object
    The Input URL object in HTML DOM represents an <input> element with type = "url" attribute. The element with type url can be accessed by using getElementById() method. Syntax: document.getElementById("id"); where id is assigned to the <input> tag. Property Values: list: It returns the re
    3 min read
    HTML DOM Window frames Properties
    The HTML DOM Window frames property in HTML DOM is used to return the frame element in the form of an array object. This property represents all <iframe> elements in the current window. DOM Windowframe is a read-only property. Syntax:window.framesProperties:length property: It returns the numb
    2 min read
    HTML | DOM Window opener Properties
    The Window opener property in HTML DOM is used to return the reference of newly created windows. This property is used to return the details of the source (parent) window. A window is opened using the window.open() method and closed using the window.opener.close() method. Syntax:window.openerReturn
    2 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