eskoba
eskoba

Reputation: 566

jquery click simulation is firing but no event take place

my case is a bit different from all I have seen so far. The element is found the click event is fired but that is it. there is an event loading on the button but what is supposed to happen doesn't happen.

Here is my click code.

$(".rowclass[maininfo_name='XX'] .btn-mybottonclass:first a").click();

I also tried the following:

$(document).ready(function() {
    $(".rowclass[maininfo_name='XX'] .btn-mybottonclass:first a").trigger('click');
});




$(document).ready(function() {
    $(".rowclass[maininfo_name='XX'] .btn-mybottonclass:first > a").click(function() {
        console.log('click');
    });
});

all of them are giving the same results.

To notice I have multiple .rowclass classes, within which I have .btn-mybottonclass and within each .btn-mybottonclass I have a hyperlink. I however want to click on the first .btn-mybottonclass hyperlink. I hope I am making sense.

Upvotes: 1

Views: 63

Answers (1)

eskoba
eskoba

Reputation: 566

I finally found the solution for those who are interested:

$(".rowclass[maininfo_name='XX'] .btn-mybottonclass:first a")[0].click();

Upvotes: 2

Related Questions