岁月无痕

岁月-人生
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

简单的换行和空格.

Posted on 2005-07-16 21:02  岁月无痕  阅读(99)  评论(0)    收藏  举报

    Today, a friend from QQ group ask me a question, how to add "<br>" and "&nbsp;" into textbox auto,
I give him the sample code:

   function CheckKeyPress(textbox)
  {
    var code
    code=event.KeyCode
    switch(code)
    {
         case 13:
             textbox.value=textbox.value + "<br/>"
            break
        case 20:
            textbox.value=textbox.value + "&nbsp;"
           break
    }
  }