请问3-18练习中,打印结果怎么没有换行显示?

请问3-18练习中,打印结果怎么没有换行显示?

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>数据类型转换</title>
</head>
<body>
<script>
    // 补充代码
    var a="50px",
        b="px50",
        c="50px50",
        d="50.51";
        
    document.write(parseInt(a));
    document.write(parseInt(b));
    document.write(parseInt(c));
    document.write(parseInt(d));
    
    document.write(typeof parseInt(a));
    document.write(typeof  parseInt(b));
    document.write(typeof  parseInt(c));
    document.write(typeof parseInt(d));
    
</script>
</body>
</html>


正在回答

登陆购买课程后可参与讨论,去登陆

2回答

你好同学 , 使用document.write在页面中显示的时候并不会自动换行 ,需要设置换行标签 ,如下

http://img1.sycdn.imooc.com//climg/5c7ca15000018de606440247.jpg

祝学习愉快 ,望采纳 .

伽文Sama 2019-03-04 11:12:09

document.write 是什么鬼?

问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师