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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:43:41+00:00 2026-06-12T19:43:41+00:00

Is it possible to create a page which changes on click on various elements

  • 0

Is it possible to create a page which changes on click on various elements and bind multiple events to various elements of the page without using any javascript?

  • 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-12T19:43:42+00:00Added an answer on June 12, 2026 at 7:43 pm

    Yes, it is, there are multiple ways to do this, it can be done using :focus, :active, :checked. View demo.

    Following is an example using :checked why I choose this over the others is because it simplifies writing css rules and allows me to use multiple elements to interact with it from various places. But enough talking, the html:

    <input type="checkbox" id="cb1" /><span>This will change color</span>
    

    and the css:

    span { color: red; }
    input:checked + span { color: blue; }
    

    You may say that checkboxes are ugly and they don’t look the same on all browsers, that is true, but you don’t have to display them, you can use a label with a for attribute to affect the state of the checkbox, for the previous example this can be achieved using:

    <label for="cb1">Click here to toggle checkbox</label>
    

    Ok, but now you may think things get complicated because you use 2 elements instead of one, yes, but at the same time, due to the fact that <label for="id"> selects an element by id you can place your label anywhere you like in the document, and more than that you can use multiple labels to change the state of the same input. and you can give them their own ids or classes and style them differently as well if you want.

    Even more is that you can combine multiple input’s states and add a rule on that if you’d like to which, from what I know is currently not available with any other pure HTML + CSS solution.

    For a more complicated example and even a micro-demo of a lightbox like effect achieved using this see this fiddle.

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

Sidebar

Related Questions

Is it possible/easy to create a web page which would act like a Microsoft
Is it possible to create a Javascript and include it in a web page
Possible Duplicate: JavaScript library to create div-style window within page I would like to
Is it possible to create advance search option like that of google page in
I currently create an object on page load with all possible key/value pairs and
I want to create a Thread safe JSP page. It is possible in Servlet
Possible Duplicate: jQuery voting system I've been using this tutorial to create a voting
I understand that it is possible to serve a custom Error 404 page using
Possible Duplicate: Multiple index variables in PHP foreach loop I am trying to create
I have to create a web page which can be set to full screen(I

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.