有轻微的问题,此代码:上e.keycode == 9(标签),加上12位,防止默认行为
jQuery.fn.markCursor = function(e){
$(this).focus();
$(this).keyup(function(e) {
$cursorStart.enterText(e);
});
};
jQuery.fn.enterText = function(e){
if (e.keyCode == 9){
$cursor.val("");
alert("hello");
}
};
TAB键被诉诸它的默认行为在浏览器中,会.preventdefault帮助在这里?如何在jquery中添加12个空格而不占用12行代码:p
“会.preventdefault帮助吗?” - 你有没有试过? – MacMac
是的,我尝试过,但看起来标签有一个明确的问题,我只是想知道是否有其他人更清晰 – re1man