Alex Rivera | Logout

Is there a way to detect find on the page searches in javascript

Asked 2011-07-13T14:06:43.507
19

each browser has find on page functionality (ctrl+F). Is there a way to detect user searches in javascript so that I could attach additional actions.

Edit
Report

1 Answer

8

You could do (to detect whenb a user press ctrl+f):

window.onkeydown = function(e){
   if(e.keyCode == 70 && e.ctrlKey){
    //user pressed ctrl+f
}

Fiddle here: http://jsfiddle.net/d8T72/

answered 2011-07-13T14:10:14.863

Your Answer