JSFiddle - React, Tailwind, and code Playground

HTML

<svg>
    <circle id="edit" cx="100" cy="100" r="10"/>
</svg>
<object type="image/svg+xml" id="svgContainer" data="http://www.petercollingridge.co.uk/sites/files/peter/svg_two_squares.svg">Your browser does not support SVG</object>

JavaScript

$(function() {
    // working
    $("#edit").attr('fill', 'green');
    
    // not working
    $("#rect1").attr('fill', 'black');
});