Clean up and rename `findAndSetFocus` method in js.

The naming conventions in the `findAndSetFocus` method have been
improved, and the method is renamed to `getFocusedElement`.

An unnecessary variable was also eliminated.