Textbox events?

六月ゝ 毕业季﹏ 提交于 2019-11-27 19:37:47

问题


I am using Kantu to automate filling out some forms. There is a textbox that when a persons id number is entered and you click into another box or tab out of the textbox it will load that persons vcard. I can try to expound if you need more clarity.

I don't know much but i'm guessing me clicking into another box is activiating some kind of event to load this vcard. I can't seem to simulate this. Does anyone know of a way to do so?


回答1:


Welcome to SO. There are different option to get the associated events.

Let's take the stackoverflow search box (the one which is on the top with s-input js-search-field class)

1) Using getEventListeners

Go to chrome console in the dev tools and then use getEventListeners(element).

getEventListeners(document.querySelector('.s-input.js-search-field '))

2) Using Dev Tools Event Listner

Go to chrome dev tools and select the element for which you want to know the events, click on the Event Listeners tab on the right hand side pane.

3) Using the firefox event

Goto dev tools in firefox and click on events bubble at the end of html element tag.




回答2:


Sample of code

I consulted with a friend who showed me the problem was an onblur event triggered by clicking away.

The solution to my problem was to call the event using the following line,

{
  "Command": "storeEval",
  "Target": "lawformTextBlur(document.getElementById('_f4'))",
  "Value": ""
},


来源:https://stackoverflow.com/questions/55977388/textbox-events

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!