I have an object created inside a container-fluid div. I create the object Bootbox with no problem whatsoever to generate a modal confirm (code below).
$("div.container-fluid").on("click", "button#geraModal", function() {
bootbox.confirm({
title: "What is your real name?",
message: "<div class="row"> <div class="col-md-3>" +
"<div id="exemplo"> Quero acessar essa DIV </div>" +
"</div> </div>",
callback: function(result) {
if (result === false) {
alert("Confirm Cancel");
} else {
alert("Hi <b>"+result+"</b>");
}
}
});
});
When I try to access some modal object via jQuery it does not work.
I can not access any modal element via jQuery. If I want to perform a function. It only works if I put a Javascript inside div
with a onclick
event (for example).
I'm trying to access the div
of the above example as follows:
$("div.container-fluid").on("click", "div#exemplo", function() {
// Faça algo
alert("Não passa aqui");
});