JSFiddle - React, Tailwind, and code Playground

by thomas_david88

HTML

<svg>
  <g node-id="itemdat-1" style="opacity: 1" transform="matrix(1,0,0,1,-170,115)" class="node" level="1" />
  <rect x="0" y="0" height="55" width="150" fill="#039BE5" stroke-width="1" stroke="#aeaeae" rx="5" ry="5"></rect>
  <text width="230" class="field_0" style="font-size: 18px;" fill="#ffffff" x="75" y="35" text-anchor="middle">Module 1</text>
  <g data-edit-id-filed="itemdat-1" transform="matrix(1,0,0,1,130,5)" />
</svg>

JavaScript

document.querySelector('svg [node-id="itemdat-1"]').closest('svg').
querySelector('text').textContent="Mr. Bojangles"
console.log(document.querySelector('svg [node-id="itemdat-1"]').closest('svg').
querySelector('text').textContent);