I am having trouble trying to create a dynamic twitter button with JavaScript. I am trying to get the twitter button to tweet the output of a calculator I am programming. The problem is that the button won't show up. What am I doing wrong? Please help.
var twit_link = document.createElement('a');
twit_link.setAttribute('href', 'https://www.twitter.com/share');
twit_link.setAttribute('class', 'twitter-share-button');
twit_link.setAttribute('url', 'http://www.twitter.com/obamamakes';
twit_link.setAttribute('data-count', 'none');
twit_link.setAttribute('data-via', 'ObamaMakes');
twit_link.setAttribute('data-text', 'In the time it takes me to ' + activity + ', Barack Obama makes $' + i.toFixed(1);
twit_link.innerHTML = "Tweet";
$("#CalcOutput").html("In the time it takes me to <span class=\"num\">" + activity + "</span>,<br />Barack Obama makes $<span class=\"num\">" + i.toFixed(1) + "</span>");
$("#CalcOutput").append(twit_link);
I made the changes that everyone suggested, but the entire output that the calculator is supposed to produce still doesn't show up along with the twitter button. Should I provide the calculator code as well?