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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:49:49+00:00 2026-06-17T06:49:49+00:00

My question is how can I create expandable panels in an HTML form without

  • 0

My question is how can I create expandable panels in an HTML form without using javascript, so that when a user clicks on each panel it expands and displays the form.

Before click:

<ul>
    <li id="panel1"><a></a><div class="content"></div></li>
    <li id="panel2"><a></a><div class="content"></div></li>
    <li id="panel3"><a></a><div class="content"></div></li>
</ul>

After click:

<ul>
    <li id="panel1">
      <a></a>
        <div class="content">
            <form id="FORM"> ..... </form>
        </div>
    </li>
    <li id="panel2"><a></a><div class="content"></div></li>
    <li id="panel3"><a></a><div class="content"></div></li>
</ul>
  • 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-17T06:49:50+00:00Added an answer on June 17, 2026 at 6:49 am

    You can do that using :target css pseudo selector – it is not very elegant though, as clicking on the anchor tag modifies the url so it is hard to toggle the form. Best use javascript.

            <style>
            form {
                display: none;
            }
            form:target {
                    display: block;
                    background: red;
                }
            </style>
            <ul>
    <li id="panel1" ><div class="content"><a href="#form">Show form</a><form id="form" > My form <input type="text"></form></div></li>
    <li id="panel2"><div class="content">My content</div></li>
    <li id="panel3"><div class="content">My content</div></li>
    </ul>
    

    some examples of :target in action:
    http://css-tricks.com/css-target-for-off-screen-designs/ and http://css-tricks.com/on-target/

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

Sidebar

Related Questions

The answer to this SO question says that you can create an api by
I have a question about joptionpane. Using JOptionPane.showMessageDialog(...), we can create a message dialog.
The question is self-explaining, how to create a tearoff menu using GTKAda? I can't
Using git, I can create branches conceptually , without having to branch my directory
QUESTION How can I create a MySQL table so, that a field's default value
My question is: can I create a class that extends another class, but choose
Please help me model this in SQLAlchemy. A user can create a question. A
Question: How can I create a function that attaches multiple event handlers to multiple
This isn't a javascript question but I've created a fiddle so I can demonstrate
I see that I can create the the UI controls like buttons, labels and

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.