Having wrapped it in this “anonymous document function”, make sure that the button is clicked. Just in case, it tries to click before the item you want to click is loaded. This will fix this problem.
Also, remember that the identifier uses a hash (i.e. # close the button), but if you want to click on an element that has a class, replace the hash with one point (i.e. close button).
jQuery(document).ready(function() { $("#close-button").trigger('click'); });
Gary Carlyle Cook Oct 30 '16 at 10:04 2016-10-30 10:04
source share