正常项目中可以这样写吗?

来源:3-18 编程练习

为你浅笑

2019-06-08 09:16:28

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <title>数据类型转换</title>

</head>

<body>

<script>

    // 补充代码

    var a="50px",b="px50",c="50px50",d="50.51";

    console.log(parseInt(a));

    console.log(parseInt(b));

    console.log(parseInt(c));

    console.log(parseInt(d));

    document.write(parseInt(a)+"<br/>",parseInt(b)+"<br/>",parseInt(c)+"<br/>",parseInt(d));

</script>

</body>

</html>


写回答

1回答

樱桃小胖子

2019-06-09

效果实现的是可以的,理论上是可以这么写的

祝学习愉快!

0

0 学习 · 40143 问题

查看课程