Explore the community Forums Lectora Lectora Questions & Answers Remove svg tag from a shape object. Reply To: Remove svg tag from a shape object.

#366129 Score: 0
Profile photo of Tim K
Tim K
Member
contributor
beginner
intermediate
advanced
friend finder
junior moderator
advocate
wise owl
curious george
Group Member
355 pts
@timk

All you have to do is to use the suitable methods, e.g. .remove() is a jQuery method but you haven’t included jQuery so it can’t work. To do it in plain javascript:

var pBar = document.getElementById("shape390712");

var svgTag = pBar.getElementsByTagName("svg")[0];
(The method gets you a collection of all svg tags, so you have to tell js you want
to use the first, even if there's only one or run a loop to do something with all of them.)

pBar.removeChild(svgTag);