已找到JQuery元素,但不可点击

问题描述 投票:0回答:1

非常奇怪...此页面受保护或我不知道的东西吗?我试图单击下一页锚。

enter image description here

请参见this page first.

我尝试使用此元素来获取元素

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');
}
javascript jquery web click element
1个回答
0
投票

$('a.buttonNext')选择器是一个元素数组(所有具有a className的buttonNext元素),即使只有一个元素,它仍然返回一个元素的数组,而不是它自身的元素。

我假设您只有一个buttonNext元素,在这种情况下,这应该可以完成工作

buttonNext[0].click();
© www.soinside.com 2019 - 2024. All rights reserved.