如何模拟对div的点击,然后在webview中编程的触发onclick事件? [英] How do I emulate a click on a div then fire the onclick event in webview programatically?
本文介绍了如何模拟对div的点击,然后在webview中编程的触发onclick事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请帮助。
解决方案
Dom事件只需调用即可触发:
下面的代码将触发id为'#foo'的元素的点击事件
document.getElementByTagName('foo' )。点击时();
I am new to JavaScript,just created a cocoa app with a webView embedded which display the gmail iPhone site.What i want to do here is to schedule a timer method, then in the timer method,emulate a click on a refresh button to fire the on click event? Please help.
解决方案
Dom events can be fired just calling it:
The code below will fire the click event of the element with the id '#foo'
document.getElementByTagName('foo').onclick();
这篇关于如何模拟对div的点击,然后在webview中编程的触发onclick事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文