D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
sohaibghani1
Full window
Github gist
tes
Built with
blockbuilder.org
<!DOCTYPE html> <html xmlns="https://www.w3.org/1999/xhtml"><head> </head> <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script> <body> <svg id="s" xmlns="https://www.w3.org/2000/svg"/> <script type="text/javascript"> function makeSVG(tag, attrs) { var el= document.createElementNS('https://www.w3.org/2000/svg', tag); for (var k in attrs) el.setAttribute(k, attrs[k]); return el; } var circle= makeSVG('circle', {cx: 100, cy: 50, r:40, stroke: 'black', 'stroke-width': 2, fill: 'red'}); document.getElementById('s').appendChild(circle); circle.onmousedown= function() { alert('hello'); }; </script> </body></html>
https://code.jquery.com/jquery-2.2.4.min.js