So I have a new button that is written by JavaScript when the users clicks on the + button.
However it seems that the new button can not access the JavaScript click function.
I am wondering how do I fix this.
JS
$('div.btn-floating').click(function () {
//alert(this.id);
if(this.id === "addnew"){
dl= document.getElementById("newpetprofiles");
dl.insertAdjacentHTML('afterbegin','<div class="btn-floating btn-large blue waves-effect waves-light"><img src="https://ipet.xyz/template/images/russellharrower.jpg"/></div>');
}
var morphFAB = $('#overlay');
morphFAB.toggleClass('visible hidden');
if (morphFAB.hasClass('visible')) {
$('#form').addClass('animated slideInUp');
}else {
$('#form').removeClass('animated slideInUp');
}
})