JSFiddle - React, Tailwind, and code Playground
HTML
<div></div>
<p>There should be no alert saying 'transitionend'</p>
CSS
div {
background-color: lightblue;
width: 100px;
height: 100px;
left: 0px;
position: absolute;
}
JavaScript
var div = document.querySelector('div');
div.addEventListener('transitionend', () => alert('transitionend'));
div.style.transition = 'left 3s';
div.style.left = '100px';
setTimeout(function() {
div.style.transitionDuration = '1s';
div.style.transitionDelay = '-1s';
div.style.left = '300px';
}, 1500);