0
我在Android(8.0.0)上使用Google Chrome,onkeypress
未在contenteditable
div
上捕捉編輯事件。按鍵 - 不適用於Chrome移動版(Android)?
<div contenteditable ='true' onkeypress =alert("press")> When ediiting this text, you should get an alert. Does not work on Android chrome. </div>
任何解決方案?
我的問題是,我不能返回false,以防止用戶輸入 –
@DavidSomekh對不起,編輯我的答案。嘗試'onkeydown()'。 – the4kman
捕捉事件,但返回false並不妨礙用戶插入文本。任何想法? –