There is a list on a website and I am trying it simulate a click on that list item. Normally, if I click the list item with the mouse, it gets selected.
The website is created with React. I can see it in React Dev Tools too.
I tried combinations of these on the <li> element:
$($0).click();
$($0).trigger('click');
$($0).mouseover();
$($0).trigger('mouseover');
$($0).mouseenter();
$($0).trigger('mouseenter');
What is the proper way of achieving it?
P.S: The website is 3rd party and I am trying to perform the click via chrome extension - content script (basically with injecting my script in a 3rd party page)
The website is Facebook Ads Manager > Traffic




document.querySelectorAll('._hpt li')[2].click();document.querySelectorAll('._hpt li')[2]selects but.click()doesn't do the trick. I said I tried.click(). I put the link in the question, you can try it yourselfclick()and notfocus()? You also might need to target aclick-able orfocus-able element that's deeper than the<li>you've selected. Is there an anchor tag in there?click. But I want to try your solution, if you can expand it more code-wise. Thanks for your time. Also, I added a link in the question if you want to try it yourself