Invalid js setting time
When sending the short message verification code, you need to use js to set the reverse order of time. Sometimes this conventional writing method will cause js to fail. You have tried many methods to find the problem, probably because the js version is too low.
SetTimeout (showT (t-1), 5000)
Solution:
SetTimeout (function () {showT (t-1)}, 1000)
Or:
SetTimeout ("Talert (I)", 5000 );
Jquery code: You must use input to set the value so that jquery can be used to change the value.
<Input type = "button" id = "sjyzm-btn" class = "sjyzm-btn" value = "get verification code"/>
Var t = 120; showT (t); function showT (t) {if (t> 0) {$ (". sjyzm-btn "). val (t + "Sec"); setTimeout (function () {showT (t-1)}, 1000) // setTimeout (showT (t-1), 5000) // $ ('. sjyzm-btn '). attr ("disabled", true);} else {$ (". sjyzm-btn "). val ("SMS Verification"); // $ (". sjyzm-btn "). removeAttr ("disabled ");}}