I wonder if it’s possible to write a function that calls when an element is created (or visible)?
For example:
1. When you click a button a div with id “area” gets created with DOM.
2. When a div with the id “area” exist, run function “areaFunction”.
I have tried the code below, which doesn’t work.
var App = {
init: function () {
if ($("#area") == true) {
areaFunction();
});
},
}
window.onload = Capsule.init;
try: