onchange对JS的赋值改变判断不能
<!DOCTYPE HTML> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title> 文本框内容改变事件 </title> <script type="text/javascript"> function message(){ alert("您改变了文本内容!"); } function neo(){ var str=document.getElementById("n1").value; //alert(str); document.getElementById("n1").value=str+"123"; } </script> </head> <body> 个人简介:<br> <textarea id="n1" name="summary" cols="60" rows="5" onchange="message();">请写入个人简介,不少于200字!</textarea> <div onclick="neo();" style="background:#eee;">点我</div> </body> </html>