Answer the question
In order to leave comments, you need to log in
Why doesn't the click on the dynamically created button react?
if(newresults && newresults.length > 0 ){
$(".child_container").remove();
newresults.forEach((item,index) =>{
$(`<div class="child_container">
<img src="${item.bank_name}" alt="" height="150" width="150" class="bank_name">
<span class="result_child prcent">${item.percent}</span>
<span class="result_child price">${item.price} ֏</span>
<div class="details">
<span class="result_child">${item.varks_name}</span>
<span class="result_child">${item.expiry_date} ամիս</span>
<h6 class="clos">Փակել ▲</h6>
</div>
<h6 class="view">Մանրամասն ▼</h6>
</div>`).appendTo('#result')
})
}
})
// $('.view').click(function(){
// console.log(true)
// $(this).parent().find($('.details')).slideDown(1000)
// $(this).fadeOut(300)
// })
// $('.clos').click(function(){
// $(this).parent().slideUp(1000)
// $(this).parents().find(".view").fadeIn(300)
// })
$('.view').on("click" , function(){
console.log(true)
$(this).parent().find($('.details')).slideDown(1000)
$(this).fadeOut(300)
})
$('.clos').on("click" , function(){
$(this).parent().slideUp(1000)
$(this).parents().find(".view").fadeIn(300)
})
});
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