I am trying to toggle a button using below code.
import $ from "jquery";
$(".clickMe").click(function() {
$(this).text(function(i, text) {
return text === "ON" ? "OFF" : "ON";
})
});
const rootApp = document.getElementById("root");
rootApp.innerHTML = '<button class="clickMe">ON </button>'