How to use JavaScript for SVG manipulation?