简体   繁体   English

新的文本字段显示在选项卡上吗?

[英]New text-field appears on tab?

I'm not quite sure how it's done on quizlet.com, and I'm thinking of how it's done. 我不确定在quizlet.com上是如何完成的,并且我正在考虑如何完成。

Say you have just text-fields, and at the last text-field when tab is pressed it will create a new text-field. 假设您只有文本字段,并且在按下Tab键的最后一个文本字段将创建一个新的文本字段。 I'm not quite sure how to do this, and I can't find any sources on how to do this. 我不确定如何执行此操作,也找不到有关此操作的任何资料。

Either a page that gives some examples or kind of clears it up would be great. 给出一些示例的页面或将其清除的页面都会很棒。

I don't know how to detect key presses in JavaScript, a simple Google search pulled up this page: How to detect tab key is pressed in JavaScript 我不知道如何检测JavaScript中的按键,一个简单的Google搜索拉出了以下页面: 如何检测JavaScript中的Tab键

For updating the page, the loop could detect each time the tab key is pressed, and check which field it was pressed in. If the field was the last one, you could run a JavaScript loop to add a new field to the window. 为了更新页面,循环可以检测到每次按下Tab键的情况,并检查它在哪个字段中被按下。如果该字段是最后一个字段,则可以运行JavaScript循环以向窗口添加新字段。 I recently answered a question like this, adding in new fields dynamically: Multiple Dynamic Selections 我最近回答了这样的问题,并动态添加了新字段: 多个动态选择

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM