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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:31:12+00:00 2026-06-10T05:31:12+00:00

i have this HTML. <tr> <td width=75>Mon</td> <td class=bn_time width=60> <input id=mon_open name=mon_open class=time

  • 0

i have this HTML.

<tr>
    <td width="75">Mon</td>
    <td class="bn_time" width="60">
        <input id="mon_open" name="mon_open" class="time" placeholder="opening time" />
    </td>
    <td class="bn_time" width="10" align="center">-</td>
    <td class="bn_time" width="100">
        <input id="mon_close" name="mon_close" class="time" placeholder="closing time" />
    </td>
    <td colspan="3" align="center" class="bn_holiday" hidden>Holiday</td>
    <td>
        <input type="checkbox" name="mon_closed" id="mon_closed" class="bn_closed" />
        <label for="mon_closed">Closed</label>
    </td>
</tr>

i am using this jQuery.

$('.bn_closed').on('change', function() {
    var element = $(this);
    var id = element.attr('id');
    var day = id.slice(0,-7);
    var day_open = day+'_open';
    var day_close = day+'_close';
    var checked = element.is(':checked');
    var td = element.closest("td");
    td.siblings(".bn_time").toggle(!checked);
    td.siblings(".bn_holiday").toggle(checked);
});

to achieve the following.

if($('.bn_closed').is(':checked')) {
     //hide all <td> element with class bn_time
     //show <td> element with class bn_holiday
} else {
    //show all <td> element with class bn_time
    //hide <td> element with class bn_holiday
}

this works with change event of .bn_closed however when the page is reloaded and if the element with class .bn_closed is checked. the toggling does not comes into effect. what i want is the toggling should take place in the event of page reload too. how do i go with it?

thank you

  • 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-10T05:31:14+00:00Added an answer on June 10, 2026 at 5:31 am

    Try this:

    $('.bn_closed').on('change', function() {
        // ...
    }).change()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have this html. <tr> <td width=75>Mon</td> <td class=bn_time width=60> <input id=mon_open name=mon_open class=time
have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:
I have a simple html form. This form has a specific width and margin
I have some html snippet <div id=title>This is title<span id=close>X<span><div> The width of this
i have this html: <span class=price> $61.00 <span class=detailFreeShipping>With Free Shipping</span> </span> How to
I have this html: <div class=foo parent> <div class=child></div> </div> with some css: .foo{
I have this HTML code: <body> <div id=div0 style=display:inline; background-color:green; width:100%> <div id=div1 style=display:inline;
so I have this HTML table with a bunch of big numbers in it
I have this html code that i want to edit with jQuery. Here is
Suppose we have this example: http://techdroid.kbeanie.com/2009/07/custom-listview-for-android.html with source code available here: http://code.google.com/p/myandroidwidgets/source/browse/trunk/Phonebook/src/com/abeanie/ How can

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.