Enable a javascript plugin on button press
===

I have a webpage on which there a button.<br/> 
On button press, I intent to embed a script in the `head` section of the page to enable a plugin. I can manually insert the snippet and my plugin but I want to be able to do this on button click itself to keep it as an optional element for my users.<br/>
What is the way to go about this?