A
A
Artem Shchurin2015-10-30 16:01:57
JavaScript
Artem Shchurin, 2015-10-30 16:01:57

How to remove viewBox attribute in IE?

I work with an interactive svg map, dynamically insert xml markup into the dom, viewBox interferes with svg for scaling, I delete it before inserting it regularly, now the requirements have changed and you need to delete the viewBox after insertion, I can delete any other attributes but not it.

js:
svg[0].removeAttribute('viewBox')
jquery:
svg.removeAttr('viewBox')

how else can I try to remove?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Zachinalov, 2015-10-30
@SanDiesel

Try
svg[0].attributes.removeNamedItem('viewBox')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question