gumuruh
gumuruh

Reputation: 2570

JQuery Element found but it's not clickable

Very strange... This page is something protected or anything i don't know? I tried to click Next page anchor.

enter image description here

See this page first.

I tried to grab the element using this

var buttonNext = $('a.next-page');

if(buttonNext.length > 0){
    console.log('found!');

    // but when clicking still give the page not move or anything
    buttonNext.click();

    // or even no effect at all, same thing...
    buttonNext.trigger('click');
}

Upvotes: 0

Views: 54

Answers (1)

user443917
user443917

Reputation:

$('a.buttonNext') selector is an array of elements (all a elements with a buttonNext className), even if there is only one element it still return an array of one element, not the element it self.

I presume you have only one buttonNext element, in that case this should do the work

buttonNext[0].click();

Upvotes: 1

Related Questions