I have an unordered list based accordion style menu which is included on every SHTML page. There is a function that identifies the <li><a...> element and colours it. There are 2 "dropdowns", each being in a <div> with a unique id. There are also some <li><a...> elements that are not within the dropdown <div>s (See below)
When the page loads I wish to identify which div is the parent of the page's <li><a..>
e.g. If the page loaded is ItemB.html then I need to know the <div> id is "div2".
I am going round in circles trying to sort this out - can anyone help please?
Code:
<ul>
<li><a style="color: #000000" ref="index.shtml">Home</a></li>
<li style="background-color: #a9acb6;"><a style="color:#000000" href="#" onclick="toggle_div('div1');">Dropdown1</a></li>
<div id="div1" style="display:block;">
<ul>
<li><a style="padding-left:13px;color: blue" href="item1.shtml">Item1</a></li>
<li><a style="padding-left:13px;color: blue" href="item2.shtml">Item2</a></li>
<li><a style="padding-left:13px;color: blue" href="item3.shtml">Item3</a></li>
</ul>
</div>
<li style="background-color: #a9acb6;"><a style="color: #000000" href="#" onclick="toggle_div('div2');">Dropdown2</a></li>
<div id="div2" style="display:none;">
<ul>
<li><a style="padding-left:13px;color: blue" href="itemA.shtml">ItemA</a></li>
<li><a style="padding-left:13px;color: blue" href="itemB.shtml">ItemB</a></li>
<li><a style="padding-left:13px;color: blue" href="itemC.shtml">ItemC</a></li>
</ul>
</div>
<li><a style="color: #000000" href="ItemX.shtml">ItemX</a></li>
<li><a style="color: #000000" href="ItemY.shtml">ItemY</a></li>
<li><a style="color: #000000" href="ItemZ.shtml">ItemZ</a></li>
</ul>
When the page loads I wish to identify which div is the parent of the page's <li><a..>
e.g. If the page loaded is ItemB.html then I need to know the <div> id is "div2".
I am going round in circles trying to sort this out - can anyone help please?