//圖片在div中居中顯示: //javascript去除兩端空格var pwd=" 123 ";pwd=pwd.replace(/^s+|s+$/pwd")pwd=pwd.replace(/^s+|s+$/pwd"); ="123"//javascript滾回界面頂部window.scrollTo(0,0);//javascript正則表達式判斷字符串是否全由數字字符組成if( str.match(/ d/)== null) alert("輸入數值錯誤!");else alert("數值正確!");🎜