JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<body>
<svg width="500" height="400">
</svg>
<button id="btn1">Append text</button>
</body>
JavaScript
$(document).ready(function(){
$("#btn1").click(function(){
$("svg").append(' <line x1="10" y1="10" x2="40" y2="40" style="stroke: black">' );
console.log("done!");
});
});