Clicking Treeitem in Javascript

For a project, I need to be able to click a treeview/item in plain javascript. I’ve tried this a couple of ways, but


// click the second treeitem
source.getElementsByClassName(“v-menubar-menuitem-caption”)[1]
.click();

However, while I see the focus being set to the specific treeitem - the actual ‘click’ never happens. Is it possible to simulate a click?

–arthur