JSFiddle - React, Tailwind, and code Playground

by Alexander Shutov

HTML

<svg>
    <path id="path" d="M50,50 100,200" stroke="red" />
</svg>

JavaScript

var path = document.getElementById('path');

setTimeout(function () {
    path.setAttribute('stroke', 'green');
    setTimeout(function () {
        path.setAttribute('d', 'M50,50 200,100');
        setTimeout(function () {
            path.setAttribute('stroke', 'red');
        }, 1000)
    }, 1000);
}, 1000);