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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:56:28+00:00 2026-06-14T05:56:28+00:00

I have a script: <script> $(function(){ $(#projectReqTable,body).on({‘click’:function(event){ event.preventDefault(); $(this).closest(tr.main).nextUntil(tr.main).toggle(slow); }}, a.main,null); }); </script> What

  • 0

I have a script:

<script>
$(function(){
  $("#projectReqTable","body").on({'click':function(event){
    event.preventDefault();
    $(this).closest("tr.main").nextUntil("tr.main").toggle("slow");
   }},
   "a.main",null);
});
</script>

What this do is it shows/hides rows on table. Now they are shown and I need to click on button to hide them. How do I hide then automatically on page load?

CSS property of hidden does the tricks, but I cannot filter afterwards the cells are shown. I need to hide them on page load ant the use the script to show them.

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

    Use trigger() function in jquery

    You can Trigger the button click event on page load

    $("#projectReqTable","body").trigger('click');
    

    hope this helps

    More clearly

    <script type="text/javascript">
    $(document).ready(function(){
       $("#projectReqTable","body").on({'click':function(event){
        event.preventDefault();
        $(this).closest("tr.main").nextUntil("tr.main").toggle("slow");
       }},
       "a.main",null);
    
    
       $("#projectReqTable","body").trigger('click');
    
    });
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following jquery script: $(function(){ $('#top-menu').on('click', 'a.change-menu', function(e){ e.preventDefault() $(#menu-change-div).load($(this).attr(href)); }); });
I have script like this : $(#addk).bind(click, function(event){ //alert(here!); $(#loader-overlay).show(); $.ajax({ 'async':False, 'type': POST,
i have script like this $('.parent a').live('mouseover mouseout', function(event) { if (event.type == 'mouseover'){
i have script pseudocode: var value = $('#select2').val(); var i = 0; $(this).click(function(){ if(value
I have a java script function that i have called on body load mousemove()
I have this script loaded on a page: (function() { window.alert('bookmarklet started'); function AjaxSuccess(data,
I have a script which similar to this: foo.php class Foo { function Foo()
I have a script that looks like this #!/bin/bash function something() { echo hello
I have this script: function slideSwitch() { var ae = jQuery('#featured-right a.active'); if (
I have this script: $(function() { $(this).ajaxStart(function() { $(#loading).show(); }); $(this).ajaxStop(function() { $(#loading).hide(); });

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.