JSFiddle - React, Tailwind, and code Playground

HTML

<p>Click on the path to change the color.</p>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
  <path d="M10,60 L50,10 90,60" />
</svg>

CSS

body { margin:1em; text-align:center }
path {
    fill:red;
    stroke:black;
    stroke-width:3;
    stroke-linejoin:round;
    stroke-linecap:round;
}

JavaScript

var colors = "0f0 0ff f60 f0f 00f f00".split(' '), i=0;
jQuery(function($){
    $('path').click(function(){
        this.style.fill = "#"+colors[i++%colors.length];
    });
});