新來javascript。我知道這可能很簡單,但我無法弄清楚。我想執行一個函數。在函數中間暫停並等待用戶點擊「enter」鍵,這將允許函數再次繼續(或者將調用另一個函數來觸發)。暫停功能,直到輸入鍵被按下javascript
function appear()
{
document.getElementById("firstt").style.visibility="visible";
//here is where I want the pause to happen until the user presses "enter" key
//Below is what I want to happen after the "enter" key has been pressed.
document.getElementById("startrouter").style.visibility="visible";
}
無法完成。抱歉。 –
它可以做到。只是不在一個單一的方法。您將不得不將這個函數分解爲幾個部分,並且從Enter事件處理程序中執行延遲代碼。 –
@尼克羅斯是的。這不是「暫停方法」,但是;-) –