Add Youtube Subscribe Button using Javascript
<p>I am attempting to add a youtube subscribe button dynamically to my site like so:</p>

<pre><code>&lt;script src="https://apis.google.com/js/platform.js"&gt;&lt;/script&gt;
&lt;div id="youtubeContainer"&gt;&lt;/div&gt;       
...
window.onload = function() {
    document.getElementById("youtubeContainer").innerHTML = ('&lt;div class="g-ytsubscribe" data-channel="GoogleDevelopers" data-layout="default" data-count="default"&gt;&lt;/div&gt;');
}
</code></pre>

<p>But the button is not visible. I am wondering if there is a way to load a youtube subscribe button dynamically so I can enter a new channel name/id?</p>