使用jQuery,單擊鏈接時如何模擬(觸發(fā)?)KeyPress?例如,當用戶單擊以下鏈接時:<a id="clickforspace" href="#">Click Here</a>然后,通過單擊鏈接,就好像他們按下了鍵盤上的“空格鍵”一樣。我假設(shè)是這樣的:$("#clickforspace").click(function(e) { e.preventDefault(); //... Some type of code here to initiate "spacebar" // });關(guān)于如何實現(xiàn)這一目標的任何想法?
用jQuery模擬按鍵
慕尼黑8549860
2019-11-13 15:26:24