Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getElementById error

Status
Not open for further replies.

ThomasE

Technical User
Nov 20, 2002
12
0
0
AU
I am trying to write a value into another page with the section of code below but I am getting an error in the Netscape 7 javascript console saying ' Error: document.getElementById("Title") has no properties

It works ok in IE6 but not NS7

list += &quot;<table width='100%' cellspacing='2' cellpadding='4' border='0' align=right>\n&quot; + document.getElementById(&quot;Title&quot;).options(document.getElementById(&quot;Title&quot;).selectedIndex).text + &quot;<br>&quot;;

Can someone please tell me what is wrong with the code

Thank You
 
Can someone please help me with this problem, it is very urgent.......thank you
 
Guessing...

'Title' should be 'title' (and IE is helpfully trying to cover the problem by returning 'Title').

Or, there is more than one
Code:
id=&quot;Title&quot;
in the document. IE finds the one you're thinking of, NS another.
 
Hey found the problem after much searching........

The enclosing brackets ( should be [

document.getElementById(&quot;Title&quot;).options[document.getElementById(&quot;Title&quot;).selectedIndex].text

works fine now
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top