Universal WebTech
  • Home
  • About US
    • Our Team
    • Privacy Policy
    • Our Clients
    • Terms of use
  • Service
    • Web Development
    • E-Commerce
    • Android Development
    • UI UX Design
  • Our Portfolio
  • Career
  • Blogs
contact
hamburger

Convert .SVG image

Below is script to convert svg image from img tag to SVG tag. After converting image in svg tag you can able to fill color in that image.

jQuery('img.svg').each(function(){
var $img = jQuery(this);
var imgID = $img.attr('id');
var imgClass = $img.attr('class');
var imgURL = $img.attr('src');
jQuery.get(imgURL, function(data) {
var $svg = jQuery(data).find('svg');
if(typeof imgID !== 'undefined') {
$svg = $svg.attr('id', imgID);
}
if(typeof imgClass !== 'undefined') {
$svg = $svg.attr('class', imgClass+' replaced-svg');
}
$svg = $svg.removeAttr('xmlns:a');
$img.replaceWith($svg);
]}, 'xml');
});

Universal WebTech

Universal WebTech IT Solutions is a leading web and mobile development company in Ahmedabad, India that believes in winning trust of its clients through 100% quality service and time-oriented work.

Company

  • About us
  • Careers
  • FAQs
  • Testimonials
  • Blogs
  • Our team

Service

  • Web Development
  • Android Application Development
  • eCommerce Web Development
  • Open Source Customization
  • UI / UX / Logo Design Services

Copyright © 2025 Universal WebTech

  • Terms of use
  • Privacy Policy