-
Notifications
You must be signed in to change notification settings - Fork 24
Remove attributes
petercollingridge edited this page Feb 1, 2012
·
3 revisions
Automatically-generated SVGs often use various attributes that aren't don't affect how to the image is displayed. For example, often, all elements are given an id attributes which aren't used for styling or animations.
To remove an attribute, x, call: svg.removeAttributes(x)
Multiple attributes can be removed by calling the method with a comma-separated list. e.g. svg.removeAttributes(x, y, z)
Often SVGs will contain many attributes from associated with a namespace, which aren't required. For example, elements in Inkscape SVGs often contain attributes prefixed with 'sodipodi:'. To remove all of these, use the removeNamespace()
method.