JSFiddle - React, Tailwind, and code Playground
HTML
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div id="likeWrapper">
<div id="like" class="fb-like" data-href="http://hittingtreeswithsticks.com" data-send="true" data-width="450" data-show-faces="true"></div>
</div>
<button id="google">google</button>
<button id="stackoverflow">stackoverflow</button>
<button id="yourSite">a page on your site</button>
JavaScript
function changeUrl(url) {
$('#like').attr('data-href' , url);
if (typeof FB !== 'undefined') {
FB.XFBML.parse(document.getElementById('likeWrapper'));
}
}
$('#stackoverflow').click(function() { changeUrl('http://www.stackoverflow.com') });
$('#google').click(function() { changeUrl('http://www.google.com') });
$('#yourSite').click(function() { changeUrl('http://www.hittingtreeswithsticks.com/?action=viewimage&site=comics&id=2&') });