JSFiddle - React, Tailwind, and code Playground
by Karan1412
HTML
<html>
<head>
<title>prepend</title>
</head>
<body>
<span>This is 99codingexamples.</span>
<p id="targetP">This is p element.</p><br />
<input type="button" id="myButton" value="Prepend"/>
<input type="button" id="reset" value="Reset" onclick="location.reload()" />
</body>
</html>
JavaScript
$(document).ready(function () {
$("#myButton").click(function () {
$("#targetP").prepend($('span'));
});
});