Question: `EDIT` Helping people understand the question better

Can you call a argument and then use it in jQuery? I was thinking something like:

```
// Notice the "test" argument in the "foo" function
function foo(test) {
  $("#randomDiv").click(function(){
    $(test).toggle();
  });
}

```

Would something like this work?

Answer: 
That's because `focus()` is not supported in jqLite and from the Angular docs on element.
A non-directive based method could look like this. It is what i used, since i have a 'next' button at the bottom of each page that is actually in index.html in the footer. I use this code in main.js.

```
if (!$scope.yourformname.$valid) {
      // find the invalid elements
      var visibleInvalids = angular.element.find('.ng-invalid:visible');

      if (angular.isDefined(visibleInvalids)){
        // if we find one, set focus
        visibleInvalids[0].focus();
      }

      return;
    }

```