JSFiddle - React, Tailwind, and code Playground

HTML

<div class="xyz">
<a>Hello <b class="caret"></b></a>
</div>

CSS

.xyz{
    border:1px solid #000;
    width:50px;
    position:relative;
}


.caret{
  width:5px;
  height:5px;
  background : blue;  
  float:left; 
  position:absolute;
  top:8px;
  left:40px;    
}

JavaScript

var blueButton = '<b class="caret"></b>';

$('.xyz').click(function(){
   $(this).find('a').html('hello2 '+blueButton); 
    
});