Link: Click here for a button!

Display button here: 
Code: <a href="javascript:void(0);" onclick="renderYtSubscribeButton('GoogleDevelopers')">Click here for a button!</a> Display button here: <div id="yt-button-container-render"></div> <script> function renderYtSubscribeButton(channel) { var container = document.getElementById('yt-button-container-render'); var options = { 'channel': channel, 'layout': 'full' }; gapi.ytsubscribe.render(container, options); } </script> <b>Link:</b> <a href="javascript:void(0);" onclick="renderYtSubscribeButton('GoogleDevelopers')">Click here for a button!</a> <b>Display button here:</b> <div id="yt-button-container-render" style="display:inline"></div>