Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi can you please tell me how to add click event on menu option ..
JavaScript
function onMenuClick()
{
    if (menuShown)
    {
//      hideMenu();
        document.getElementById('menu').style.display = 'none';
    }

    else
    {
//      showMenu();
        document.getElementById('menu').style.display = 'block';
    }
    menuShown = !menuShown;
}

in body*************
XML
<div id='menu'> 
<ul> 
<li>Menu option 1</li> 
<li>Menu option 2</li> 
<li>Menu option 3</li> 
</ul> 
</div>
Posted
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

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

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900