function trim(s) {
var count = s.length;
var st = 0; // start
var end = count-1; // end
if (s == "") return s;
while (st < count) {
if (s.charAt(st) == " ")
st ++;
else
break;
}
while (end > st) {
if (s.charAt(end) == " ")
end --;
else
break;
}
return s.substring(st,end + 1);
}
username: <input type="text" name="name">
password: <input type="password" name="pwd"> <br>
<input type="submit" value="提交" onclick="isEmpty()">
</form>
return true;
}
新闻热点
疑难解答