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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:16:59+00:00 2026-06-08T21:16:59+00:00

I currently added a collapsible paragraph function to my webpage. I used the code

  • 0

I currently added a collapsible paragraph function to my webpage. I used the code that I found on http://www.javascriptsource.com/miscellaneous/expand-collapse-paragraph.html#comment_listing. Basically, I have a very long paragraph that is hidden until the button is clicked, but you have to scroll all the way back to the top to click on the same button to collapse the paragraph. I was wondering if there a way where I can add a “close” button at the end of the paragraph so that I don’t have to scroll to the top.

Thank you.

Here is the code for js, css, and html files:

CSS

input.button {
  color: #fff; background: #0034D0;
  font-size: .8em;
  font-weight:bold;
  font-family: Verdana, Arial, Helvetica, sans-serif;
  border: solid 1px #ffcf31;
}

external JavaScript file named: expandCollapse.js

function toggleMe(a){
  var e=document.getElementById(a);
  if(!e)return true;
  if(e.style.display=="none"){
    e.style.display="block"
  } else {
    e.style.display="none"
  }
  return true;
}

BODY section of HTML document before actual paragraph

<center><input type="button" class="button" onClick="return toggleMe('para1')" value="Animation Characters Guide"></center>
    <div id="para1" style="display:none">

    </div>

If I want to add a “close” button, would it be a “a href” tag?

  • 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-08T21:17:01+00:00Added an answer on June 8, 2026 at 9:17 pm

    If I want to add a “close” button, would it be a “a href” tag?

    Yes, You could use a link:

    <a href="#" onclick="toggleMe('para1'); return false"> hide </a>
    

    or you could use another button:

    <input type="button" class="button" onclick="return toggleMe('para1')" value="Are the JavaScripts here free?" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Update Added jsfiddle - see bottom of post I currently have a function that
Currently I was trying the jquery,css dropdown which is from here. http://www.jankoatwarpspeed.com/post/2009/07/28/reinventing-drop-down-with-css-jquery.aspx I added
I read this: http://symfony.com/doc/current/book/service_container.html It said: $mailer = $this->get('my_mailer'); As an added bonus, the
Currently, each web service for our application has a user parameter that is added
I currently have a C# Workbook-level Office 2007 Addin that has a Worksheet added
I have a file that should be added as binary but currently is not.
UPDATE 1 ADDED UPDATED CODE I have a django template on app engine. Currently
I'm currently working on a website admin panel, I added a form that adds
I'm currently trying to make the function below work correctly. Recently added the IF
I am currently working on an application that generates C# code files and adds

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.