💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
![](https://box.kancloud.cn/463aa3a918ff1d414fdc23bb85e5df62_363x304.gif) ~~~ <div id="test" style="height: 100px;"></div> <script> // string-->number /* parseInt(); parseFloat(); Tip;第一为必需位数字 */ var test = document.getElementById("test"); var height = test.style.height; console.log(parseInt(height)); test.onclick = function(){ this.style.height = parseInt(this.style.height)+1+"px"; } var a ="12px"; var b = "a1"; var c ="13.25px" console.log(parseInt(a)); console.log(parseInt(b)); console.log(parseInt(c)); console.log(parseFloat(c)); </script> ~~~