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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Object doesn't support this property or method Error.

Status
Not open for further replies.
Oct 11, 2006
300
US
Hi,

I have a function:

Code:
//Get all the links of the UL tag
function collectULLinks() {
	var ulObj = document.getElementByID("menu") // id of the first UL tag in the tree.
	ulObjLinks = document.getElementsByTagName("a") // <a> tags of the UL tree which are the <a href> tags.
}

HTML is:

Code:
<ul id="menu">
  <li>
  	<input type="radio" checked id="empid" name="empid" value="4655">
    <a href="#" class="a_style" onClick="s_Hide('4655')">TopMgr</a>
    	<ul id="4655" class="ulcontent">
    		<li>
    			<input type="radio" id="empid" name="empid" value="2109922">
    			<a href="#" class="a_style" onClick="s_Hide('2109922'); return false;">Mgr1</a>
				<ul id="2109922" class="ulcontent">
    				<li>
    					<input type="radio" id="empid" name="empid" value="8693">
    					Sub1
    				</li>
    				<li>
    					<input type="radio" id="empid" name="empid" value="8793">
    					Sub2
    				</li>
    				<li>
    					<input type="radio" id="empid" name="empid" value="8893">
    					Sub3
    				</li>
    			</ul>
    		</li>
......

I am calling the top most UL tag with the id "menu" from the function.

In the Java Console, I get an error message:

Object doesn't support this Property or Method at line 90 where line 90 refers to:

Code:
var ulObj = document.getElementByID("menu") // id of the first UL tag in the tree.

What mistake am I making?

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top