Click to See Complete Forum and Search --> : [RESOLVED] can I use anchor link inside an unordered list?


Captainkewl
03-28-2009, 09:19 PM
Hey guys. I want to link to a spot within the same XHTML document. Here is what I have:

<ul id="nav3">
<li><a name="notify">PLEASE NOTIFY US WHEN..</a></li>
<li><a href="ages.html">AGES OF CHILDREN</a></li>
<li><a href="vacation.html">VACATION</a></li>
<li><a href="hours.html">HOURS OF OPERATION</a></li>
<li><a href="feepayment.html">FEE PAYMENT SCHEDULE</a></li>
</ul>

<a href="#notify">
<ul id="list">
<li>Someone else will be picking up your child</li>
<li>Your child will not be attending on a certain day (ill etc.)</li>
<li>You will be late picking up your child</li>
<li>You will be late bringing your child</li>
</ul></a>

So when the "PLEASE NOTIFY US WHEN.." is clicked, it will take them to the <ul id="list"> section, but it is not working. Any ideas?

Thanks,
Kris.

dmboyd
03-28-2009, 09:51 PM
You're doing it backward. The target object is what should have the name (and id) attributes attached. The source object, the object you click to get to the target object, should have the href attribute attached.

Try this:
<ul id="nav3">
<li><a href="#notify">PLEASE NOTIFY US WHEN..</a></li>
<li><a href="ages.html">AGES OF CHILDREN</a></li>
<li><a href="vacation.html">VACATION</a></li>
<li><a href="hours.html">HOURS OF OPERATION</a></li>
<li><a href="feepayment.html">FEE PAYMENT SCHEDULE</a></li>
</ul>

<a name="notify" id="notify">&nbsp;</a>
<ul id="list">
<li>Someone else will be picking up your child</li>
<li>Your child will not be attending on a certain day (ill etc.)</li>
<li>You will be late picking up your child</li>
<li>You will be late bringing your child</li>
</ul>

Captainkewl
03-29-2009, 05:40 AM
Your right, I was doing it backwards. Thanks for the help, much appreciated.

Kris.