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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:03:10+00:00 2026-06-10T12:03:10+00:00

I have one HTML page with one toggle button and some drop down item.

  • 0

I have one HTML page with one toggle button and some drop down item. My toggle button is like on-off.
What i need?? I need to hide drop down item when i click on “ON” and show drop-down when i click
on “off”. I am very newbie on HTML , CSS, JQuery. Here is my code of HTML file which work only
for toggle.

<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" 
type="text/javascript"></script>
<script src="jquery/iphone-style-checkboxes.js" type="text/javascript"
charset="utf-8"></script>
<link rel="stylesheet" href="style.css" type="text/css" media="screen"
charset="utf-8" />
<style type="text/css">
   body {padding: 10px; }
 th {text-align: right;padding: 4px;padding-right: 15px;vertical-align: top; }
.css_sized_container .iPhoneCheckContainer {width: 250px; }
</style>

<script type="text/javascript" charset="utf-8">
$(window).load(function() {
  $('.on_off :checkbox').iphoneStyle();
  $('.disabled :checkbox').iphoneStyle();
  $('.css_sized_container :checkbox').iphoneStyle({
     resizeContainer: false, resizeHandle: false
  });
  $('.long_tiny :checkbox').iphoneStyle({
     checkedLabel: 'Very Long Text', uncheckedLabel: 'Tiny'
  });

  var onchange_checkbox = ($('.onchange :checkbox')).iphoneStyle({
    onChange: function(elem, value) { 
      $('span#status').html(value.toString());

    }
  });

  setInterval(function() {
    onchange_checkbox.prop(
     'checked', !onchange_checkbox.is(':checked')).iphoneStyle("refresh");
    return
  }, 2500);
});

</script>  
</head>
<body>
  <table><tr class="on_off">
    <td>
      <input type="checkbox" id="on_off" />
    </td>
  </tr></table>
</body>
</html>

I know following function use for hide and show.

$(document).ready(function(){
   $("#hide").click(function(){
      $("p").hide();
   });
    $("#show").click(function(){
      $("p").show();
   });
});  

But i don’t understand how this function implement in javascript.
because above function work on two button and i use only one button..
Please give me any hint or direct me where i wrong?….

  • 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-10T12:03:11+00:00Added an answer on June 10, 2026 at 12:03 pm

    You can use toggle method:

    Display or hide the matched elements.

    $("#button").click(function(){
         $("p").toggle();
    });
    

    Or according to your markup:

    $("#on_off").change(function(){
         $("p").css('display', this.checked ? 'block' : 'none');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have about 25 show/hide (toggle) elements on a page like so... HTML: <h2><a
I am creating one form in html using table. Which have one Drop down
I've got some HTML like the following: <ul> <li><a href=#>Page 1</a></li> <li><a href=# class=toggle>[Open|Close]</a><a
My problem is I have one html table in jsp page .And i applied
In my html page, I have one table, for every row there are two
I have one page website only using HTML, CSS and JavaScript. I want to
i have 2 html page the first one is the login page and the
Hi I have one separate page for footer as footer.html & I want to
in my html page, I have the following: <div id=rub> Select at least one
I have multiple javascript functions in my html page. One of them, by far

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.