HTML - Textarea - 空格的问题解决方式

第一种方式:

<textarea name="textareaname" rows="XX" cols="XX" ></textarea>
这样就ok了,<textarea ></textarea >这两个中间不要有空格或是其他的字符

 

 

第二种方式:  直接设置下鼠标事件onmousedown就可以的

<html>

<body>
  <script>
  function s(e,a)
  {
    if ( e && e.preventDefault )
      e.preventDefault();
    else 
      window.event.returnValue=false;
    a.focus();

}
</script>
  <textarea id="anan" onmousedown="s(event,this)"></textarea>
  </body>
</html>

posted @ 2015-08-25 10:31  czhyuwj  阅读(449)  评论(0)    收藏  举报