Sohaib Mohammed Sohaib Mohammed - 1 month ago 4
Javascript Question

vivus.js - How to select SVG by Class

Is there a way to select SVG by Class instead of ID , Like this:

<svg class="mySVG">

new Vivus('.mySVG', {duration: 200}, myCallback);


Since you can have multiple elements with same class

  var els= document.getElementsByClassName("mySVG");

  for (var i = els.length - 1; i >= 0; i--) {
    new Vivus(els[i], {duration: 200}, myCallback);