将alert(输入的文本中共包含 ${result} 个汉字);改为以下代码,实现在页面中显示检测结果:

const resultDiv = document.createElement('div'); resultDiv.textContent = 输入的文本中共包含 ${result} 个汉字; document.body.appendChild(resultDiv);

把alert写成输出显示!DOCTYPE htmlhtmlhead	title汉字检测器title	meta charset=UTF-8	style		 居中显示 		body 			display flex;			flex-direction column;			align-items center;			justify-content center;			height 100vh;			mar

原文地址: https://www.cveoy.top/t/topic/Nk1 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录