JSFiddle - React, Tailwind, and code Playground

by fredd man

HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery Replace innerHTML of a Div</title>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script>

$(document).ready(function(){
  $("button").click(function(){
    $("#pageTitle").clone().appendTo("card");
  });
});

$(document).ready(function(){
    $("button").click(function(){
        $("#pageTitle").html("<div class="card">k</div>");
    });
});

</script>
</head>
<body>
    <div id="pageTitle">
   <div class="card"></div>
    </div>
    <button type="button">Replace HTML</button>
</body>
</html>