JSFiddle - React, Tailwind, and code Playground
HTML
<form id="name">
<select onChange="changeDomain(this.value);">
<option value="abc" selected>abc</option>
<option value="xyz">xyz</option>
</select>
</form>
<div id="comments">
<div class="fb-comments" href="http://example.com/some/abc" num_posts="20" width="500"></div>
<div id="fb-root"></div>
</div>
<script type="text/javascript">
(function loadfb(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&appId=1234567890";
fjs.parentNode.insertBefore(js, fjs);
})(document, 'script', 'facebook-jssdk');
function changeDomain(value) {
var newVal = '<div class="fb-comments" href="http://example.com/some/' + value + '" num_posts="20" width="500"></div><div id="fb-root"></div>';
$('#comments').html(newVal);
FB.XFBML.parse($('#comments').get(0),function(){
$(".FB_Loader").remove();
});
}
</script>