JSFiddle - React, Tailwind, and code Playground
HTML
<button id="bold">B</button>
<button id="add_txt">Add txtarea</button>
<div id="vk_main">
</div>
CSS
textarea {
font-weight: normal;
}
textarea:first-line {
font-weight: bold;
}
JavaScript
var c = 0;
$.activeEl = $();
$('#add_txt').on('click', function() {
var $div = $('<textarea id="ta_' + (c) + '">Text here.</textarea>');
$('#vk_main').append($div);
});
$("textarea").live("focus",function() {
$.activeEl = $(this);
});
$("#bold").click(function() {
$.activeEl.css("font-weight", "bold");
});