Click here to Skip to main content
13,046,337 members (111,692 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
Hi
can you please tell me how to add click event on menu option ..
function onMenuClick()
{
    if (menuShown)
    {
//      hideMenu();
        document.getElementById('menu').style.display = 'none';
    }
 
    else
    {
//      showMenu();
        document.getElementById('menu').style.display = 'block';
    }
    menuShown = !menuShown;
}

in body*************
<div id='menu'> 
<ul> 
<li>Menu option 1</li> 
<li>Menu option 2</li> 
<li>Menu option 3</li> 
</ul> 
</div>
Posted 6-Oct-12 12:39pm
Updated 6-Oct-12 19:38pm
v3
Comments
ravi1989h 6-Oct-12 21:44pm
   
</div>

<div id='menu'>
<ul>
<li>Menu option 1</li>
<li>Menu option 2</li>
<li>Menu option 3</li>
</ul>
</div>
Thilina Chandima 6-Oct-12 22:40pm
   
your question not clear with your sample code.. so please describe your problem more
ravi1989h 6-Oct-12 23:25pm
   
i got answer ,thanks for help

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

i got answer ,thanks for help
OP posted, he found the answer. Posting it to pop it out of unanswered list.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 7 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100