I want to create a variable to make my code more generic. here is the code I am working on:

```
eventHandler: function(event) {
    if (event.keyCode == KEY_DOWN) {
        if (this.hasNextSibling(document.activeElement.parentNode)) {
             this.setFocus(document.activeElement.parentNode.nextSibling.firstChild);
         } else {
              this.debug("out");
         }
    }
},
setFocus: function(item)
{
document.activeElement.tabIndex = "-1";
item.focus();
document.activeElement.tabIndex = "0";
},
...

```

The part where I have "document.activeElement.parentNode.nextSibling.firstChild" is the problem. What I want to do first, in order to be able to reuse the code, is to set a variable like this:

```
var test = document.activeElement.parentNode.nextSibling.firstChild; /*CHANGE HERE*/
eventHandler: function(event) {
    if (event.keyCode == KEY_DOWN) {
        if (this.hasNextSibling(document.activeElement.parentNode)) {
             this.setFocus(test); /*CHANGE HERE*/
         } else {
              this.debug("out");
         }
    }
},
setFocus: function(item)
{
document.activeElement.tabIndex = "-1";
item.focus();
document.activeElement.tabIndex = "0";
},
...

```

The code does not compile. I tried many different approaches, like method referencing, but nothing seems to work. Does anyone have an idea?

thanks a lot

EDIT:
here is what I actually would like:

```
var x = parentNode.nextSibling.firstChild;
eventHandler: function(event) {
    if (event.keyCode == KEY_DOWN) {
        if (this.hasNextSibling(parent)) {
             this.setFocus(document.activeElement.x);
         } else {
              this.debug("out");
         }
    }
},
setFocus: function(item)
{
document.activeElement.tabIndex = "-1";
item.focus();
document.activeElement.tabIndex = "0";
},

```

the semantic is not correct. Is there a way I can do that?
thanks