Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js get svg width

var el   = document.getElementById("yourElement"); // or other selector like querySelector()
var rect = el.getBoundingClientRect(); // get the bounding rectangle

console.log( rect.width );
console.log( rect.height);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #svg #width
ADD COMMENT
Topic
Name
1+7 =