简体   繁体   English

无法在无序列表项上触发点击事件

[英]Not able to trigger click event on unordered list item

在此处输入图片说明 Anyone can help me in this issue.任何人都可以帮助我解决这个问题。

In the given image, there is list item which contains nested div.在给定的图像中,有一个包含嵌套 div 的列表项。 I am doing automation, so I want to trigger click on the item, either on li or inside div.我正在做自动化,所以我想触发对项目的点击,无论是在 li 上还是在 div 内。 I tried in console to fire click event as我尝试在控制台中触发点击事件

document.querySelector('#__item89-__picker1--PopupFrag--searchResult-0').click();

but its giving me undefined.但它给了我未定义的。 I also tried我也试过

document.getElementById('__item89-__picker1--PopupFrag--searchResult-0').click();

and getting same undefined.并获得相同的未定义。

在此处输入图片说明 Anyone can help me in this issue.任何人都可以帮助我解决这个问题。

In the given image, there is list item which contains nested div.在给定的图像中,有一个包含嵌套 div 的列表项。 I am doing automation, so I want to trigger click on the item, either on li or inside div.我正在做自动化,所以我想触发对项目的点击,无论是在 li 上还是在 div 内。 I tried in console to fire click event as我尝试在控制台中触发点击事件

document.querySelector('#__item89-__picker1--PopupFrag--searchResult-0').click();

but its giving me undefined.但它给了我未定义的。 I also tried我也试过

document.getElementById('__item89-__picker1--PopupFrag--searchResult-0').click();

and getting same undefined.并获得相同的未定义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM