Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8792905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:02:55+00:00 2026-06-13T23:02:55+00:00

Sorry If this is simple but I need some help with my navigation bar.

  • 0

Sorry If this is simple but I need some help with my navigation bar. I can’t seem to be able to toggle to show/hide the div with the click of a link. My code is here. This is just some a basic format as I want the right functionality before adding it to my website. Thanks!

<html>
<head>
<link rel="stylesheet" type="text/css">
<style>
#submenu ul{
display:none;
}
</style>
<script type="text/javascript">
function showDiv() {
document.getElementById('submenu').style.display = "block";
}
</script>
</head>
<body>
<div id="navigation">
<ul>
<li id="submenu" onclick="showDiv()";><a href="#"> Hi</a>
<ul>
<li><a href="#"> Hi2</a>
</ul>
</li>
</ul>
</div>
</body>
</html>

So in this example I want the hidden div to show Hi2 once I click Hi1. I don’t mind using JQuery or Javascript I just need a way around this. I’ve made other navigation menus’s however they were horizontal and usually worked by hover menus. Appreciate any help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:02:56+00:00Added an answer on June 13, 2026 at 11:02 pm

    Use this

     $('#submenu').click(function() {
      $('#submenu ul').toggle('');
    });
    

    DEMO


    If you dont want to toggle then use

    $('#submenu').click(function() {
      $('#submenu ul').css('display','block');
    });
    

    DEMO 2

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry if this sounds simple, but I'm looking for some help to improve my
sorry this is such a simple question but I can't figure it out. How
Sorry for this simple question, but I can't solve it... There is an example:
Sorry, I'm sure this is simple but I'm tired and can't figure it out.
I'm sorry if this is too simple for some people, but I still don't
Sorry if this is a dead simple question but I'm confused from the documentation
Sorry if this is too simple, but thanks in advance for helping. This is
I'm dealing with a specific and simple case. I need some help, because I
This might be a dumb question but I can't get this super simple script
Sorry for this simple questions but i am too much confused with how to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.