How to simulate click event on an input box

后端 未结 2 1213
离开以前
离开以前 2021-01-25 02:05

I am trying to simulate click on an input box. When its clicked manually, a drop down auto suggestion box appears as suggestions about past searches. However, when I try to simu

2条回答
  •  孤独总比滥情好
    2021-01-25 02:48

    You need to .focus() instead of .click()

    document.getElementbyClassName("gb_cf")[0].focus(); //or
    document.getElementbyId("gs_taif50").focus();
    

提交回复
热议问题