var text = '42px'; var integer = parseInt(text, 10); // returns 42. parseFloat() parseFloat()方法可將字串轉換成包含小數點的數字.
確定! 回上一頁