當我的JSP頁面被加載時,該按鈕(實際上是一個圖像按鈕onfocus
財產)得到專注。所以,按下輸入它被點擊。這是一個小問題,是一個更大問題的一部分。如何在加載頁面時使按鈕失去焦點?如何使頁面加載時失去焦點
<html>
<head>
</head>
<body>
<div onkeypress =handleEnter()>
name <input type="text" src='Create.gif' >
</br>
<input type="image" src='Create.gif' onclick="alert('not done')">
<input type="image" src='Create.gif' onclick="alert('done')">
</div>
</body>
<script>
function handleEnter()
{
if(window.event.keyCode==13)
{
alert('nothing');
event.cancelBubble=true;
}
}
</script>
</html>
都白白警告框,而不是做的都已經表明
在這裏發佈您的代碼.. –
將焦點設置上的一些其他控制,如文本框等 –
@theghostofc如何做到這一點? – user2644549