Answer the question
In order to leave comments, you need to log in
How to set viewBox programmatically?
let svgElem = document.createElement('svg');
svgElem.setAttribute('width', 500);
svgElem.setAttribute('height', 500);
svgElem.setAttribute('viewBox', '0 0 50 50');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question