parseInt() 是把其它类型转换为整型 var str="100px"; console.log( parseInt(str) ) //100 parseFloat() 是把其它类型转换为浮点型(小数) var str1="1.3亿"; console.