String.prototype.trim = function () {
return this.replace(/(^\s*)|(\s*$)/g, "");
}
使用方法 string.trim();
關於 Select 標籤,獲取選中的值/文本
var test = document.GetElementById("test");
var test_value = test.options[test.options.selectedIndex].value;
var test_txt = test.options[test.options.selectedIndex].text;
alert(test_value);