Structure is as following:
div
h1
a
p
.more-info
When I click on .more-info div I need to simulate a click on the 'a'.
$(".more-info").click(function() {
$(this).parent().find('h1').find('a').get(0).trigger('click');
})
This gives following error:
$(...).parent(...).find(...).find(...).get(...).trigger is not a function
Output of
console.log($(this).parent().find('h1').find('a').get(0))
is the correct element I need to click.
I've tried without .get(0) and get following when I log that
[a, prevObject: jQuery.fn.init(1), context: p.more-info, selector: "h1 a"]