Answer the question
In order to leave comments, you need to log in
How can I display a div on click from a modal window?
I have an implementation of my own alert and I get nothing when I click on the button. Here is something that should come out https://jsfiddle.net/hollanditkzn/szqpcorx/1/
But I placed this code in my modal window
$('body').on('click', '.alert-confirm', function (e) {
e.preventDefault();
console.log('Hello world');
let div = document.createElement('div');
div.style.cssText = "text-align:" +
"center;padding:10px;" +
"position:fixed;" +
"width:200px;" +
"height:40px;" +
"bottom:50%;" +
"right:50%;" +
"margin-right:-100px;" +
"margin-bottom:-20px;";
console.log(div);
div.onclick = function (e) {
let t = e ? e.target : window.event.srcElement;
if(t === 'INPUT'){
t.value === 'Да' && alert('Да');
this.parentNode.removeChild(this);
}
};
div.innerHTML='<div>'+$('.alert-confirm').data('title') +'<br/>'+$('.alert-confirm').data('message')+'</div><input type="button" value="Да"><input type="button" value="Нет">';
console.log(div);
displays, and what is not below. How can I be here? Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question