JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/ui-lightness/jquery-ui.css">
<div class="name"> Bob Marley</div>
<div class="message">Hey friend, how are you?</div>
JavaScript
$('div.message').text(function(i, txt) {
var name = $.trim($('div.name').text()).split(' ')[0];
return txt.replace('friend', name);
});