I have this code for some elements in my web that I want to do this:
When user clicks in a div, trigger a click on the button inside div (in this case, these buttons open a modal), This works in other places in the page where I make a window.location instead a trigger. What is bad with this code? I dont know it :(
Sorry my english, thanks.
jQuery(".hover-content").click(function(e){
var hl = jQuery(this);
jQuery(this).find("button").each(function(){
if(jQuery(this).is(":visible")){
jQuery(this).trigger("click");
}
});
});
Console shows this error:
Uncaught RangeError: Maximum call stack size exceeded
Little example: https://jsfiddle.net/z0704nss/