innerHTML获取标签内容

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>index</title>
    <style>
        *{
            font-family: 微软雅黑;
        }
    </style>
</head>
<body>
    <h1 info='linux is very much!' id='hid' class='hcls'>linux is very much!</h1>
</body>
<script>
hidobj=document.getElementById('hid');
alert(hidobj.innerHTML);
</script>
</html>

 

posted @ 2020-12-27 22:35  大熊童鞋  阅读(341)  评论(0编辑  收藏  举报