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')
.
精彩评论