jQuery addClass example

Change class name on click in jQuery

HTML

<svg width="100%" height="100%" viewBox="0 0 401 201"
     xmlns="http://www.w3.org/2000/svg" 
     xmlns:xlink="http://www.w3.org/1999/xlink">
     
     <defs>
    <linearGradient
       id="linearGradient857">
      <stop
         id="stop853"
         offset="0"
         style="stop-color:#000000;stop-opacity:0" />
      <stop
         style="stop-color:#000000;stop-opacity:1"
         offset="0.3"
         id="stop863" />
      <stop
         style="stop-color:#000000;stop-opacity:1"
         offset="0.7"
         id="stop861" />
      <stop
         id="stop855"
         offset="1"
         style="stop-color:#000000;stop-opacity:0;" />
    </linearGradient>
    <linearGradient
       gradientUnits="userSpaceOnUse"
       y2="0"
       x2="0"
       y1="201"
       x1="0"
       id="linearGradient859"
       xlink:href="#linearGradient857" />
  </defs>
  <g>
<image xlink:href="https://media.boingboing.net/wp-content/uploads/2018/05/cool-background1.png" x="0" y="0" height="201" width="401" /> 
<g transform="translate(150)"><text
       id="text817"
       y="16.541666"
       x="21.166666"
       style="font-style:normal;font-weight:normal;font-size:10.58333302px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:url(#linearGradient859);fill-opacity:1;stroke:none;stroke-width:0.26458332"
       xml:space="preserve"
       >
       <tspan
         style="stroke-width:0.26458332;fill-opacity:1;fill:url(#linearGradient859)"
         y="16.541666"
         x="21.166666"
         id="tspan815">qweqwejnwe.r werw erwer ,</tspan><tspan
         id="tspan819"
         style="stroke-width:0.26458332;fill-opacity:1;fill:url(#linearGradient859)"
         y="29.770832"
         x="21.166666">qweqwejnwe.r werw erwer ,</tspan><tspan
         id="tspan821"
         style="stroke-width:0.26458332;fill-opacity:1;fill:url(#linearGradient859)"
         y="43"
         x="21.166666">qweqwejnwe.r werw erwer ,</tspan><tspan
         id="tspan823"
    ...