Jump to content
Sign in to follow this  
rifts

Help with javascript

Recommended Posts

rifts

hey everyone i have a javascript code which makes a word toggle links under it

for example

before clicking on it it looks like this:

Stories:

then once its clicked on it looks like:

Stories:

story 1

story 2

story 3

how can i make it so when you click stories it creats that list and also goes to story 1

here is the code i have

<h2 style="margin-left : 25px;"><img src="/images/sort_ASC.gif" id="img_DegreeList5" alt="" /><a href="javascript:toggleDegreeList(5);" style="color:#336699;">Teaching Tales</a></a></h2> 
                                <div id="DegreeList5" style="display:none;"> 

                     <ul><ul> 
                        <li><a href="teaching_tales1.php">Story 1</a></li>
            <li><a href="teaching_tales2.php">Story 2</a></li>
                    </ul></ul> 
                            </div>

Share this post


Link to post
Share on other sites
jvanegmond

Apart from two ul elements, your HTML looks fine. Better probably is use onclick on a element and href to #. What's your javascript code?

Share this post


Link to post
Share on other sites
rifts

i figured out a way to do it

thanks for looking

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×