然后用户使用 TAB 或 SHIFT-TAB “跳转”到某个文本框,并且该文本框恰好有一个值,那么该值将被自动选择。我想禁用此行为。
我认为这可以在 focusin 事件处理程序内部完成:
$("input:text").focusin(function() {
// "un-select" the value and place the text-cursor
// at the beginning or end of the value
});
$(function() {
$('input').bind('focus', function(e) {
return false;
});
});
使用 jQuery 1.4.3+,您可以使用快捷方式版本:
$(function() {
$('input').bind('focus', false);
});
例子:http://www.jsfiddle.net/P8LDB/ http://www.jsfiddle.net/P8LDB/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)