2016-09-15 145 views
-2

我需要檢查輸入值是否大於4500毫微秒。 我該怎麼做?jQuery - 如何檢查值是否超過4500毫秒?

HTML

<input type=hidden id="time" value="1276664400"> 

jQuery的

var currenttime = $.now(); 

if ($("#time").val() < currenttime) { 

alert("I am older than 4500 miliseconds!"); 

} 
+1

CURRENTTIME - 4500應該做的伎倆 – Daffy13

+0

OMG,爲什麼人們總是負的代表我。 – user3304007

+0

也許是因爲這不是什麼攫取鉛筆和紙張不會解決的,它不是火箭科學數學 – charlietfl

回答

1
var currenttime = $.now(); 
if ($("#time").val() < (currenttime - 4500)) { 
    alert("I am older than 4500 miliseconds!"); 
}