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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:28:30+00:00 2026-05-18T07:28:30+00:00

I am using html and js, and I want to display a chunk of

  • 0

I am using html and js, and I want to display a chunk of html code if the user clicks something. The code is a bit big so using document.getElementById("display").innerHTML = is not attractive. I googled and found out about IFrame, but I want to avoid scroll bars and stuff, I hoped I could use a simple div, how can I do that? I am using jquery as well, I know about the hide() function in jquery, but the thing is that the stuff in the div with id display should change dynamically, so if the user clicks item1 he should get text1, item2 should get text2, and i want to have a specific place for textx

  • 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-18T07:28:31+00:00Added an answer on May 18, 2026 at 7:28 am

    It sounds like you’re looking for something like

    $('.ShowLink').click(function() { 
        $('#' + this.rel).toggle();
        return false;
    });
    

    This will toggle the element with the ID specified by the rel= attribute of each element with the ShowLink class.
    For example:

    <a href="#" rel="Text1" class="ShowLink">Show something</a>
    ...
    <div id="Text1">
        Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to be able to display some simple chunks of HTML in my
Using the Authors/Books catalog example, let's say I want to edit the info for
I'm trying to set up a website using HTML and JavaScript that displays sections
I have Dropdown and on click of a button, I want to display data
I've been tryin to find an example of the syntax for getting an html
It would appear that I am suffering from a new bug in IE7, as
A common scenario I encounter is providing notifications / confirmations to users after they
I been reading on asp.net mvc learning site about JavaScript injection and man it
I am trying to create a help panel for an application I am working
I can think of a number of ways to do this in PHP or

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.