SVG Modified with Query String

In this example below you will see how to do a SVG Modified with Query String with some HTML / CSS and Javascript

Create one SVG that allows you to change colours by changing query string. SVG has code in it to break it down.

This awesome code was written by jnowland, you can see more from this user in the personal repository.
You can find the original code on
Copyright jnowland ©


  • HTML
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

  <meta charset="UTF-8">
  <title>SVG Modified with Query String</title>
  <script src="" type="text/javascript"></script>



  <img src="" alt="Default SVG" />

<img src="" alt="SVG With query strings" />

<object type="image/svg+xml" data=""></object>

    <script  src="js/index.js"></script>



/*Downloaded from */
// Javascript doesn't fire on SVGs unless you view them direct

// Update: or you put them in an object tag.