简体   繁体   中英

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.

Say you have just text-fields, and at the last text-field when tab is pressed it will create a new text-field. 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

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. I recently answered a question like this, adding in new fields dynamically: Multiple Dynamic Selections

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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