I have a succession of divs inside other divs that simulate some windows inside others, one of these windows invokes another and each one has its close button, I want from the window that invoked it to close the window invoked by means of
$(document).find("#contenedorventana #boton").click();
It was working fine for me, but the click event stopped working, any way to make my invocation of the click event work?
Note: If I close the window from the close button it works correctly, the problem is when calling the event to automatically close it from the calling window
I don't understand why you tell the DOM to search for the element if it is referenced by an ID, you also shouldn't do a redundant search if you already know the button. Enough with
Or if you say it's a button inside a DIV you can do
Be careful with this last one because if you have more than one button in the DIV it will act in a strange way.
Well, researching I found the solution, although I still haven't fully understood why it works like this haha but well, it turns out that instead of
I just had to add
So thanks anyway for your answers.
you can use pure javascript, sometimes the jquery methods do not work for x or for y. That is why this library is deprecated.