hao_2468

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

<script type="text/javascript">

function button_translateClick() {    事件内容 }

function text_wordKeydown(e) {//这个是文本框的回车的事件,调用上边提交的事件
    if (!e) e = window.event;
    switch (e.keyCode | e.which | e.charCode) {
        case 13:
            button_translateClick();
            break;
    }
}

</script >

<input id="text_word" type="text" value="hello" onkeydown="text_wordKeydown(event)" />
<input type="button" value="提交" onclick="button_translateClick()"/>

posted on 2010-01-04 10:25  hao_2468  阅读(171)  评论(0编辑  收藏  举报