我有一个用于输入数字的文本字段。我想提醒我输入到文本字段中的数字。我的HTML是:文本字段中的警报字段值
<input id="search_number" type="text" name="numbers" />
<button id="wmsearch">Search</button>
和JS是:
var sn = ($('#search_number').val());
$('#wmsearch').click(function(){
if(sn != 1234567890){
alert(sn);
}else
{
alert('equal');
}
});
它不工作...