JSFiddle - React, Tailwind, and code Playground
HTML
<div id="CalcOutput"></div>
JavaScript
$(function() {
var i = 4;
var activity = 'do stuff';
var twit_link = $('<a/>', {
href: 'https://www.twitter.com/share',
'class': 'twitter-share-button',
url: 'http://www.twitter.com/obamamakes',
'data-count': 'none',
'data-via': 'ObamaMakes',
'data-text': 'In the time it takes me to ' + activity + ', Barack Obama makes $' + i.toFixed(1) // whatever you want here
}).text('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);
});