天天看點

tagName擷取标簽名

<!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.tagName);
</script>
</html>      

繼續閱讀