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 6055797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:18:18+00:00 2026-05-23T08:18:18+00:00

I am developing a site where I can NOT use jQuery (please, no comments

  • 0

I am developing a site where I can NOT use jQuery (please, no comments on how good is it, it’s prohibited) and I need to reproduce something like .toggle() just for show/hide a div with a class.

I’ve a group of boxes with a arrow, this arrow can expand a submenu. Let’s see an example:

<div class="box">
    <div class="box-utils">
        <a href="#" class="up">&nbsp;</a>
    </div>

    <h2>Example case</h2>

    <div class="box-submenu hidden">
        <ul />
    </div>
</div>

I need that click on the <a /> inside the <div class="box-utils" /> shows/hide the box-submenu class. When it’s hidden, the <a /> needs to have class=”down”, when it’s not hidden it needs to be class=”up”. This also needs to work with more than one case in the same page.

Can someone help me?

Thank you in advance!

  • 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-05-23T08:18:18+00:00Added an answer on May 23, 2026 at 8:18 am

    Create a toggle function like the one below, provide an id attribute on your DIV (call it box-submenu or something) and call the function from your anchor, and use the ID to lookup whatever you want to hide/show.

    <script language="javascript"> 
    function toggle() {
        var ele = document.getElementById("box-submenu");
        var link = document.getElementById("linkId");
        if(ele.style.display == "block") {
            ele.style.display = "none";
            link.className = "down";
        }
        else {
            ele.style.display = "block";
            link.className = "up";
        }
    } 
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a web site, which would make use of PHP, Javascript (JQuery) and
I've been developing a site using ASP.NET MVC, and have decided to use the
I am developing a site in vertigoserver. Now I need to test the webpage
I'm developing a site using jQuery, and jQuery UI tabs. For some reason, my
I am currently developing a site and have a need for a javascript-based carousel/slider
I am developing a library for Android applications which does not use native code
I'm developing a web site in a high-security environment. For example, we use CAC
I am developing an ASP.net site (using .NET 4, EF, jQuery Ajax, SQL Server
I'm developing a site and fairly new to jquery. For some reason, when I
I am currently developing a jquery function which I intend to use to replace

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.