<!--把如下代碼加入<body>區域中--> <script langauge="Javascript"> function check() { var l = document.theform.words.length alert("你已經輸入了"+document.theform.words.value.length+"個字母") } </script> <form name="theform"> <INPUT TYPE="text" name = "Words" value = "這個輸入框中的字母個數能被檢測出來" size = 40> <input type="button" value="檢測"onClick="check()"> </form>