ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

className用法

2021-11-25 18:32:42  阅读:17  来源: 互联网

标签:Span xhtml1 len 用法 className toredC thistextar


4.className用法
例 4.1(keyIEFF.html)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>
    </title>
    <script language="JavaScript" type="text/javascript">
        function calc(thistextar, Span) {
            var len = thistextar.value.length;
            Span.innerHTML = len + ' 字';
            Span.className = 'toredC';
        }
    </script>
    <style type="text/css">
        <!--
        .toredC {
            color: #FF0000;
        }
        -->
    </style>
</head>
<body><textarea cols="50" rows="3"  onKeyUp="calc(this,document.getElementById('num'))"
        ></textarea>
(<SPAN id=num>字数</SPAN>)
</body>
</html>

更多内容请见原文,文章转载自:https://blog.csdn.net/qq_43650923/article/details/102822703

标签:Span,xhtml1,len,用法,className,toredC,thistextar
来源: https://www.cnblogs.com/malala/p/15604037.html

专注分享技术,共同学习,共同进步。侵权联系[admin#icode9.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有