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.
我正在开发一个使用 jquery 自动完成的网页,jquery 自动完成的来源是名称和值的对象文字。该名称显示在自动完成列表中。我希望当用户单击自动完成项时,页面应该重定向到我存储在名称字段中的链接。怎么可能?
您可以将 onChange 事件用于文本字段选择器,并在其中使用带有对象文字名称的窗口位置 href。
$('#textField').onChange(function() { window.location.href="location you want to redirect"; });
告诉我是否有帮助或我必须进行编辑