JSFiddle - React, Tailwind, and code Playground
HTML
<div id="Menu">
Button will be inserted here
</div>
<script id="MenuOption1" type="text/javascript">
<button type="button" class="MyButton">Doesn't Work</button>
</script>
<button type="button" class="PerformInsert">
Insert
</button>
<button type="button" class="MyButton">
Does Work
</button>
JavaScript
$(document).ready(function() {
$(".MyButton").on("click", function() {
alert("success!");
});
$(".PerformInsert").on("click", function() {
$("#Menu").html($("#MenuOption1").html());
});
})