In JavaScript, the transitionend event fires when a CSS transition has completed (MDN)—in both directions (toward the new state and when fully reverting). The event object is a TransitionEvent. It is not cancelable. If transitioncancel fires, transitionend will not fire for that transition.
Register a listener with addEventListener. Check readiness and browser support before you rely on this event.
Syntax
Listen for transitionend. Start with this line.
JavaScript
el.addEventListener("transitionend", fn)
Call
What it does
el.addEventListener("transitionend", fn)
Primary signature.
Built into the browser. Listen with el.addEventListener("transitionend", …) — no import required.
Attach both listeners. End and cancel are separate outcomes.
Finish path. Let the transition complete → only transitionend runs.
Abort path. Reverse early → only transitioncancel runs.
MDN rule. If cancel fires, end will not fire for that transition.
Compatibility
Browser Support
transitionend is Baseline Widely available on MDN (across browsers since October 2018). It is a standard CSS Transitions event, not Deprecated or Experimental.
✓ Baseline · Widely available
Element transitionend
Fires when a CSS transition completes. Supported in modern Chrome, Firefox, Safari, and Edge.
95%Modern browser support
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
Android WebViewSupported · Modern WebView
Full support
transitionendExcellent
Bottom line: Safe to use in modern web apps. Pair with transitioncancel when abort cleanup matters.
Frequently Asked Questions
It fires when a CSS transition has completed (MDN)—both when finishing toward the transitioned state and when fully reverting to the default state. It is not cancelable.
No. MDN does not mark Element transitionend as Deprecated, Experimental, or Non-standard. It is Baseline Widely available (across browsers since October 2018).
A TransitionEvent. Useful read-only properties include propertyName, elapsedTime, and pseudoElement.
transitionend fires when the transition finishes normally. transitioncancel fires when it is aborted early. If transitioncancel fires, transitionend will not fire for that transition.
If the transition is removed before completion (for example transition-property is cleared or display is set to none), if transitioncancel fires, or if delay and duration are both 0s / undeclared so there is no transition.
Yes. MDN notes transitionend fires when the transition finishes in either direction—toward the new state and when reverting fully to the default state.