JSFiddle - React, Tailwind, and code Playground
HTML
<span id="someid">Hello</span>
<a href="#boy" id="thislink">Boy</a>
<input type="text" id="something" />
JavaScript
$("#thislink").click(function () {
var result = $("#someid").html();
var output = $("#thislink").attr("href");
if (result == "#boy"){
$("#something").attr("value", + result + " sometext here");
}
if (result == "#girl"){
$("#something").attr(output + result + " sometext here");
}
});