Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Firefoxを除くすべてのブラウザで動作するボディへのjqueryのkeyup関数のバインド
コード: -
$('body').bind('keyup', function(e) { //alert ( e.which ); alert('testing'); });
どのように私はfirefoxのためにそれを行うのですか. それは全く反応しません
ありがとう
document代わりにイベントをバインドします。
document
$(document).bind('keyup', function(e) { alert('testing'); });
ほぼすべてのノードでキーボード イベントを受け取ることができます。「最新の」ブラウザでは、tabIndex. その後、イベントはフォーカス可能です。
tabIndex
$(document.body).attr('tabIndex', 1).bind('keyup', function(e) { alert('testing'); });