<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		span{
			color: darkRed;
		}
	</style>
</head>
<body>
	<input type="text" id="type">
	<h2>您輸入了<span id="remind"></span>個字</h2>
	<h2>您輸入的ASCII碼為 <span id="keyCode"></span> </h2>
	<script type="text/javascript">
		document.getElementById('type').onkeyup=function(e){
			document.getElementById('keyCode').innerHTML=e.keyCode;
			document.getElementById('remind').innerHTML=e.target.value.length;
		}
	</script>
</body>
</html>

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 Jerry 的頭像
    Jerry

    Bug倉庫 // 程式日記

    Jerry 發表在 痞客邦 留言(0) 人氣()