0

I am trying to use Mozilla Firefox Firebug Console to test some code. Below is the line I am trying to execute to focus on the link:

document.getElementById('DEPT_TBL_DESCR$prompt').focus();

But it keeps returning this error in Firebug Console:

TypeError: document.getElementById(...) is null

Does anyone know why or how I could focus on that link/img?

Below is the code:

<a href="javascript:pAction_win0(document.win0,'DEPT_TBL_DESCR$prompt');" tabindex="35" id="DEPT_TBL_DESCR$prompt" name="DEPT_TBL_DESCR$prompt"><img border="0" align="absmiddle" title="Look up New Department ID (Alt+5)" alt="Look up New Department ID (Alt+5)" src="/cs/hr34/cache/PT_PROMPT_LOOKUP_1.gif"></a>

This is related to this IE error message: Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus.

1 Answers1

0

"$" is not a valid character as part of an ID or name for an HTML 4 element.

See: What are valid values for the id attribute in HTML?

Though it is allowed on HTML5: http://www.w3.org/html/wg/drafts/html/master/dom.html#the-id-attribute.

You have not sated which you are using.

Community
  • 1
  • 1
Diodeus - James MacFarlane
  • 107,156
  • 31
  • 147
  • 171