【发布时间】:2014-02-24 09:25:31
【问题描述】:
我在由onKeyUp 在text input field 中触发的jquery 函数中有以下if 语句
if ( famcount < 3 ) {
alert('number too small.');
} else if ( famcount > 10 ){
alert('number too large.');
}
问题是,如果用户尝试键入10,它会在 1 之后执行并触发第一个警报。有什么比onKeyUp更好的触发此事件的建议吗?
【问题讨论】: