Question: I have a HTML table with few rows. [Demo](http://jsfiddle.net/R3Jy7/2/). I want to expand all collapsed rows on hitting "Ctrl + F" on keyboard. 
Currently I using following piece of code for expand/collapse the required rows.

```
 $('#resultDetails').on('click', '.toggle', function () {
var findChildren = function (tr) {
var depth = tr.data('depth');
return tr.nextUntil($('tr').filter(function () {
return $(this).data('depth') 
<= depth;
}));};

```

[Edit] : If I am searching for a string using Ctrl + F and if any row is hidden/collapsed (and row contains the required string), then browser will not be able to find the required string as its hidden. So my idea is to capture the Ctrl+F event and expand all the rows. With above piece of code I am able to expand only those rows on which user has clicked. But I want to expand all rows once user enters Ctrl + F. 

How can I do this or any other ideas to handle this scenario. 

Thoughts.

Answer: 
Add This to your Code

```
    $('body').keydown(function(e){
    if(e.ctrlKey){
        switch(e.which){
            case 17:e.preventDefault();
                break;
            case 70:
               $('.toggle').trigger('click');
               e.preventDefault();
                break;
            default:
                break;
        }
    }
});

```

[**DEMO HERE**](http://jsfiddle.net/2USg6/1/)
With following piece of code, I am able to expand all the rows on hitting Ctrl + F.
[Fix updated](http://jsfiddle.net/R3Jy7/3/).

```
$('body').keydown(function(e){
  if(e.ctrlKey && e.which == 70){
    $(expandAll());
  }
});

function expandAll() {
    $("#resultDetails tr").each(function(){
        if ($(this).hasClass('expand')) 
           $(this).removeClass('expand').addClass('collapse');
        $(this).show();
    });
}

```

Let me know if this can be done with better approach.