This question already has answers here:
Closed 5 years ago.
I have an <svg>
element on my page and would like to give it a viewBox attribute. When I try this with jQuery, like so:
$('svg').attr('viewBox', '0 0 800 400');
It almost works, but it gives the element a "viewbox" attribute (notice the lower case 'b'). This attribute requires the camel case to work, at least in Chrome where I have tested it. Are there any workarounds?