JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#btn1").click(function(){
$("#test1").text(function(i, origText){
return "Old text: " + origText + " Nový text: Hello world! (index: " + i + ")";
});
});
$("#btn2").click(function(){
$("#test2").html(function(i, origText){
return "Old html: " + origText + " Nové html: Hello <b>world!</b> (index: " + i + ")";
});
});
});
</script>
</head>
<body>
<p id="test1">Toto je <b>tučně písmo</b> v odstavci.</p>
<p id="test2">Toto je <b>tučné písmo</b> v jiném odstavci.</p>
<button id="btn1">Ukaž Starý/Nový text</button>
<button id="btn2">Ukaž Starý/Nový HTML</button>
</body>
</html>