本文介绍了如何模拟按键按键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网页,其中javascript例程将表格交换为清除屏幕并开始一组新问题。清除屏幕后,文本框或下拉菜单只需通过ID获取元素即可获得焦点,以.focus()结尾。没问题。但是,如果屏幕上的第一个对象是单选按钮,则除非按下Tab键,否则它将不会接受焦点。如何模拟Tab键按下以使radiobutton可以获得焦点?

解决方案




I have a webpage where a javascript routine swaps tables to "clear" the screen and start a new group of questions. After the screen is cleared a textbox or a drop-down menu can receive focus by simply getting the element by ID, ending in .focus(). No problem. However, if the first object on a screen is a radiobutton it will not accept focus unless there is a tab key press. How can I simulate a tab key press so the radiobutton can receive focus?

解决方案




这篇关于如何模拟按键按键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 16:52
查看更多