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

  • SEARCH
  • Home
  • 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 9036865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:06:27+00:00 2026-06-16T09:06:27+00:00

I followed this http://jsfiddle.net/6rSvf/ to make the links change div content when clicked. However

  • 0

I followed this http://jsfiddle.net/6rSvf/ to make the links change div content when clicked. However can someone assist on how I can show a div as default and then when a link is clicked the content is replaced accordingly. Currently nothing is shown until a link is clicked.

Here is my JS.

$("#divtoggle").delegate("a", "click", function(e) {
    var toggled = ($(this).prop("id"));
    $("div#wrap").prop("class", toggled);
});

Thanks

  • 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-16T09:06:28+00:00Added an answer on June 16, 2026 at 9:06 am
    $(document).ready(function() {
        $('#div1').show();
    });
    

    OR

    $(document).ready(function() {
        $('#togglediv1').click();
    });
    

    UPDATE

    If the URL has the #hash, it will open that one, otherwise if will open the first one.

    $(document).ready(function() {
        if (window.location.hash && $(window.location.hash).length > 0) {
           $(window.location.hash).show();        
        } else {
            $('#div1').show();
        }
    });
    

    ​
    ​

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

Sidebar

Related Questions

Check out this jsfiddle http://jsfiddle.net/Y7fEW/ . I'm trying to get the tan div on
I can't login to github with generated ssh-keys. I've followed this manual: http://help.github.com/linux-key-setup but
I followed this screencast to make a erb:to:haml rake task: http://teachmetocode.com/screencasts/creating-a-rake-task-to-convert-erb-to-haml/ I backed everything
I followed this guide: http://wiki.unto.net/setting-up-clojure-and-slime Which walked me through the steps of building Clojure
I'm using http://jsfiddle.net/dhoerster/BXYpt/ from jQuery UI autocomplete with values as the basis. This does
http://jsfiddle.net/AndyMP/UpLts/1/ This is just an example for illustrative purposes, but what I want to
i am using a php script (followed this tutorial http://www.bitconsultants.net/2010/geocoding-with-google-maps-and-the-zend-framework/ ) to get the
I followed this article http://www.codeproject.com/KB/sharepoint/ASPNET_to_Sharepoint.aspx and it worked converting my ASP.net Site into SharePoint
I followed this guide http://lazyfoo.net/SDL_tutorials/lesson03/windows/codeblocks/index.php to set up the sdl image extension but now
I followed this post http://neurochannels.blogspot.com/2010/05/how-to-run-r-code-in-matlab.html , to install R(D)Com server in order to call

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.