<body><p>字数限制在30字内,<span>您还可以输入<b>30</b> 字</span></p><textarea cols="50" rows="7" id="text"></textarea><script type="text/javascript">var text = document.getElementById("text ");var total = 30;var b = document.getElementsByTagName('b')[0];console.log(b)document.onkeyup = function () {let len = text.value.length;console.log(len);allow = total - len;b.innerHTML = allow;}</script></body>
添加回答
举报
0/150
提交
取消