January 24, 2012

【JavaScript】判斷是否按了Enter

function a(e){
        if(e.keyCode==13){
        alert("OK");
        }
}

<input type="text" name="qq" onkeypress="a(event)" />

0推薦此文章
Today's Visitors: 0 Total Visitors: 24
Personal Category: 網頁Java Script Topic: feeling / personal / murmur
Previous in This Category: 【HTML】手機網頁 檔頭宣告   Next in This Category: 【PHP】限制字數 (strlen搭配substr用法)
[Trackback URL]

No one can comment

誰來收藏
Loading ...
unlog_NVPO 0