title: Html tag attribute value from javascript value
body: <p>im going crazy , im not so good on js or html so plz try to help me.
  on my blog on blogger i want to 
  1) Automatically create a short link using goo.gl service
  2) share this short link on twitter by its button
  the js code im using to make the link short</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      var shorturl;
        var longUrl="http://*****" + "&lt;data:blog.url/&gt;";
        var request = gapi.client.urlshortener.url.insert({
        'resource': {
        'longUrl': longUrl
           }
         });
         request.execute(function(response) 
         {
  
          if(response.id != null)
          {
              shorturl=response.id;
          }
          else
          {
              shorturl="&lt;data:blog.url/&gt;";
              alert("error: creating short url n"+ response.error);
          }
          document.getElementById('shorturlid').setAttribute("data-url",shorturl);
      });
      &lt;/script&gt;
  </code></pre>
  
  <p>the code for twitter button</p>
  
  <pre><code>&lt;a href="https://twitter.com/share" class="twitter-share-button" id="shorturlid" data-via="*****" data-size="large" data-count="none" data-hashtags="*****"&gt;Tweet&lt;/a&gt;
  &lt;script&gt;!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');&lt;/script&gt;
  </code></pre>
  
  <p>this just share the current page url so it seems that my code does nothing.</p>
  
  <p>Any Solution?</p>