JSFiddle - React, Tailwind, and code Playground

by Patrick Reed

HTML

<button onclick="changeSVGColor()">
Change Inner Color
</button>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve">
 <g class="next">
  <g>
   <polygon fill="#FFD92D" class="inner" points="20.587,5.055 78.706,48 20.587,90.945"/>
   <path fill="#FF9900" class="outer" d="M21.623,7.11L76.961,48L21.623,88.89V7.11 M19.55,3v90l60.9-45L19.55,3L19.55,3z"/>
  </g>
 </g>
</svg>

CSS

.inner {
  fill: #000000;
}
.inner-new-color {
    fill: #ff00ff;
}

JavaScript

function changeSVGColor() {
		$(".inner").removeClass("inner").addClass("inner-new-color");
};