jquery.replacesvg.js is a simple svg replacement plugin.
If browser support SVG, do nothing.
If not, replace star.svg with star.png.
<img src="./img/star.svg" width="100" height="95" alt="star" data-altimgsrc="./img/star.png" class="js-replacesvg1">
$('.js-replacesvg1').replacesvg({ defaultsvg: true });
If browser support SVG, replace star.png with star.svg.
If not, do nothing.
<img src="./img/star.png" width="100" height="95" alt="star" data-altimgsrc="./img/star.svg" class="js-replacesvg2">
$('.js-replacesvg2').replacesvg({ defaultsvg: false });