码迷,mamicode.com
首页 > Web开发 > 详细

松散的css

时间:2018-07-26 00:22:50      阅读:177      评论:0      收藏:0      [点我收藏+]

标签:join   rip   get   ntb   png   hello   element   com   inf   

    <style>
        <p>hello world</p>
        {}
        p {
            color: red;
        }
        {}
        <em style="padding: 4px; color: blue">hello ajanuw</em>
        {}
    </style>
<body>
    <div id="box"></div>
    <script>
        let tags = [];
        let box = document.getElementById('box');
        let sty = document.getElementsByTagName('style')[0]
        sty.innerHTML.replace(/(<.*|>\/>)/gm, $_ => tags.push($_) );
        box.innerHTML = tags.join(' ');
    </script>
</body>

技术分享图片

松散的css

标签:join   rip   get   ntb   png   hello   element   com   inf   

原文地址:https://www.cnblogs.com/ajanuw/p/9369085.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!