Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一些代码,我使用该before()方法在其中插入一个input-field。但由于某种原因,input-fields动态创建的不会触发$("input").focus().
before()
input-field
input-fields
$("input").focus()
如何让新的输入字段触发focus()?
focus()
对于动态创建的标签,您应该使用委托绑定事件,尝试
$(document).on( "focus", "your input selector", function() { });