JSFiddle - React, Tailwind, and code Playground
studying jQuery functions: html(), append(), prepend()
by jonchius
HTML
<div id="htmlSelector"><p>pre-existing content for the htmlSelector</p></div>
<div id="appendSelector"><p>pre-existing content for the appendSelector</p></div>
<div id="prependSelector"><p>pre-existing content for the prependSelector</p></div>
CSS
div {
font-family: Arial;
font-size: 14pt;
padding: 20px;
color: #fff;
}
#htmlSelector {
background: #900;
}
#appendSelector {
background: #090;
}
#prependSelector {
background: #009;
}
JavaScript
$("#htmlSelector").html("<p>content injected by jQuery</p>");
$("#appendSelector").append("<p>content injected by jQuery</p>");
$("#prependSelector").prepend("<p>content injected by jQuery</p>");