我有几个使用jQuery自动完成功能进行增强的输入字段。如何在选择事件触发时获取相应的输入字段?如何获取触发jQuery自动填充小部件的输入元素?
<input name="1" value="">
<input name="2" value="">
<input name="3" value="">
$('input[type=text]').autocomplete({
source: 'suggestions.php',
select: function(event, ui) {
// here I need the input element that have triggered the event
}
});
谢谢,这就是它!我试图$(this).name想知道为什么它是未定义的。 :) –
不客气,只是对此遗憾。 – Adil