I’m trying to use document.createElement(‘circle’) to work with svgs but Chrome creates a end tag to circle giving
<circle></circle>
which results of an error.
How can I create an element without an ending that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You might want to take a look at this article
SVG Scripting with JavaScript Part 1: Simple Circle
The method you’re looking for is:
Edit: Credit where credit is due
Stackoverflow: Creating SVG graphics using javascript?