JSFiddle - React, Tailwind, and code Playground

HTML

<!--This is the svg code (simplified) the url where I got it is below-->
<!--<svg xmlns:svg="http://www.w3.org/2000/svg" version="1.0" width="830.69293" height="275.62558" id="svg2">  
  <path style="fill:#c5e3ac;fill-opacity:1;stroke:#000000;stroke-width:0.99761558;stroke-opacity:0" d="M 196.22716,182.45416 L 338.57823,182.45416 L 338.57823,249.14011 L 196.22716,249.14011 L 196.22716,182.45416 z" id="rect2384"/>
  <path style="fill:#8a7958;fill-opacity:1;stroke:#000000;stroke-width:1.02121592;stroke-opacity:0" d="M 420.15625 0.5 L 420.15625 50.46875 L 347.40625 50.46875 L 347.40625 106.25 L 131.09375 106.25 L 131.09375 149.5 L 90.46875 149.5 L 90.46875 134.5 L 45.09375 134.5 L 45.09375 149.5 L 0.5 149.5 L 0.5 264.03125 L 184.875 264.03125 L 184.875 150.1875 L 347.40625 150.1875 L 347.40625 171.28125 L 421.40625 171.28125 C 422.39931 189.00082 437.51625 203.03952 456 203.0625 C 474.51612 203.08551 489.66407 189.0423 490.65625 171.28125 L 569.03125 171.28125 L 569.03125 150.28125 L 703.21875 150.28125 L 703.21875 171.375 L 726.6875 171.375 L 726.6875 248.90625 L 823.1875 248.90625 L 823.1875 171.375 L 830.15625 171.375 L 830.15625 127.6875 L 823.1875 127.6875 L 823.1875 74.46875 L 726.6875 74.46875 L 726.6875 106.125 L 569.03125 106.125 L 569.03125 50.46875 L 491.125 50.46875 L 491.125 0.5 L 420.15625 0.5 z " id="rect2389"/>
  <path d="M 169.07519,248.32954 C 169.07907,263.19065 160.50035,275.24085 149.91662,275.24085 C 139.33289,275.24085 130.75417,263.19065 130.75805,248.32954 C 130.75417,233.46844 139.33289,221.41824 149.91662,221.41824 C 160.50035,221.41824 169.07907,233.46844 169.07519,248.32954 L 169.07519,248.32954 z" id="path2395" style="opacity:1;fill:#b9af9b;fill-opacity:1;stroke:#000000;stroke-width:0.7694391;stroke-opacity:0"/>
  <path style="font-size:144px;font-style:normal;font-weight:normal;line-height:100%;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera...

CSS

/*
These svg style commands/attributes DO NOT EXIST in common css, so, it's clearly not usable here
and will not have any effect on your svg items!
*/
.border{
    fill:red;
    opacity:0.2
}

JavaScript

$('body').on('click','#rect2384',function(){
    console.log("clicked");
    //$(this).css('fill','red');
    $(this).toggleClass('border');
});
$('body').on('click',function(){
    if($('#rect2384').length>0){
        console.log('rect exists');
    }else{
        console.log('rect not detected');
    }
});
    //Imagine this 'svg variable' comes from the return of an ajax query!
    var svg = '<svg xmlns:svg="http://www.w3.org/2000/svg" version="1.0" width="830.69293" height="275.62558" id="svg2">  <path style="fill:#c5e3ac;fill-opacity:1;stroke:#000000;stroke-width:0.99761558;stroke-opacity:0" d="M 196.22716,182.45416 L 338.57823,182.45416 L 338.57823,249.14011 L 196.22716,249.14011 L 196.22716,182.45416 z" id="rect2384"/><path style="fill:#8a7958;fill-opacity:1;stroke:#000000;stroke-width:1.02121592;stroke-opacity:0" d="M 420.15625 0.5 L 420.15625 50.46875 L 347.40625 50.46875 L 347.40625 106.25 L 131.09375 106.25 L 131.09375 149.5 L 90.46875 149.5 L 90.46875 134.5 L 45.09375 134.5 L 45.09375 149.5 L 0.5 149.5 L 0.5 264.03125 L 184.875 264.03125 L 184.875 150.1875 L 347.40625 150.1875 L 347.40625 171.28125 L 421.40625 171.28125 C 422.39931 189.00082 437.51625 203.03952 456 203.0625 C 474.51612 203.08551 489.66407 189.0423 490.65625 171.28125 L 569.03125 171.28125 L 569.03125 150.28125 L 703.21875 150.28125 L 703.21875 171.375 L 726.6875 171.375 L 726.6875 248.90625 L 823.1875 248.90625 L 823.1875 171.375 L 830.15625 171.375 L 830.15625 127.6875 L 823.1875 127.6875 L 823.1875 74.46875 L 726.6875 74.46875 L 726.6875 106.125 L 569.03125 106.125 L 569.03125 50.46875 L 491.125 50.46875 L 491.125 0.5 L 420.15625 0.5 z " id="rect2389"/><path d="M 169.07519,248.32954 C 169.07907,263.19065 160.50035,275.24085 149.91662,275.24085 C 139.33289,275.24085 130.75417,263.19065 130.75805,248.32954 C 130.75417,233.46844 139.33289,221.41824 149.91662,221.41824 C 160.50035,221.41824 169.07907,233.46844 169.07519,248.32954 L 169.07519,248.32954 z" id="path2395"...