0

So I have in my header a JS script like this, that activates reading on my website.

<script src='//vws.responsivevoice.com/v/e?key=kukrWmCv'></script>

I want to unload the script from the header by pressing a HTML button, but I really do not know how to this. Any help apreciated.

danski
  • 309
  • 1
  • 6
  • 17

1 Answers1

1

Add an id to your script tag:

<script src='//vws.responsivevoice.com/v/e?key=kukrWmCv' id="myScript"></script>

Call a function on click of the button and have the below code in your function

var yourScript = document.createElementById('myScript');

 yourScript.setAttribute('src','');
Iman
  • 717
  • 15
  • 32