[英]How should I append a newly created element to the next to last position of another element using Javascript?
[英]How can I autofocus using Javascript on newly created element?
我有一個input
字段,如果用戶按下Enter鍵,則將其禁用,並創建另一個字段,依此類推。 我想在每次創建新input
字段時自動調整其焦點,並刪除單擊時創建的藍色邊框。
如果您不了解我,請參閱此鏈接 。
不,您一次只能關注一個元素。
您可以使用jQuery的.focus()
事件來定位新創建的input
。
要刪除藍色邊框,請使用CSS從:focus
的input
刪除outline
:
input:focus {
outline: none;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.