我想限制可以按下的键。
$('.txtComments').keydown(function (event) {
var keys = new Array();
keys[0] = "8";
keys[1] = "46";
keys[2] = "37"
keys[3] = "39"
if(!(....)) //Check whether the keyCode is either of 8, 46, 37, or 39.
{
event.preventDefault();
}
});
感谢您的帮助