开发者

Ctrl+S Triggers Function but only if inside of specific Text Area JQuery

I want to trigger a javascript function (an Ajax Post save function) when someone presses ctrl + s.

But only when they editing a sp开发者_开发百科ecific textarea (with a unique ID)

So if they aren't "focused" on the text area Ctrl+s should behave like default.


A couple of similar questions:

  • Best cross-browser method to capture CTRL+S with JQuery?

  • CTRL + S to submit form and all inputs

I bet that first one will get you well on your way to coming up with a solution. Just replace $(window) in the sample code in the accept answer with $('#yourtextareaid').

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜