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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:16:40+00:00 2026-05-26T05:16:40+00:00

I am trying to hide a table row with jQuery instead of with js

  • 0

I am trying to hide a table row with jQuery instead of with js as in this question. This is the script that I put in the header:

self.response.out.write("""
    <html>
    <head>
    <link type="text/css" rel="stylesheet" href="/stylesheets/main.css" /> 
    <title>User Admin Page</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">
    <script>
    $(document).ready(function() {
        $("#false").click(function() {
        $("#hide").hide("slow");
    });
});
</script>
<body>
""")

And here is the html:

...
<tr class="hide">
 <td>
  ...
   <a class="false" href="/useradminpage?main_id=%s&display=false"><span class="small">(hide)</span></a>
  </td>
 </tr>
</div>
...

This is not working. And this question is same as this but I cannot make mine work. What am I doing wrong?

Update

Edited code according to answers. But this is still not working although it is working in jsfiddle:

         <html><head>
         <link type="text/css" rel="stylesheet" href="/stylesheets/main.css" /> 
         <title>User Admin Page</title>
         <script  src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">

<script>


 $(document).ready(function() {

     $("a.false").click(function(e) {
     $(".hide").hide("slow");
     e.preventDefault();
          });

 });   </script> </head>
         <body>
 ...

Update

The closing </script> was missing in the CDN call; but now the entire table is hidden; I am adding that section of the table. Thanks again for the answers:

    self.response.out.write("""<table class="mytable">
    <tr class="head">
    <th  width="80%">links</th><th>edit tags</th>
    </tr>    
    """)        

    query = Main.all()
    query.filter("owner", user)
    query.filter("display", True)
    query.order("-date")
    cursor = self.request.get("cursor")
    if cursor: query.with_cursor(cursor)
    e = query.fetch(100)
    cursor = query.cursor()

    for item in e:
        main_id = item.key().id()
        self.response.out.write("""
        <tr class="hide">
        <td><a href="%s" target="_blank">%s</a><span class=small> (%s) </span><br />
        <span class=small>%s</span>
        <a href="/edit?main_id=%s"><span class="small">(edit)</span></a>
        <a class="false" href="/useradminpage?main_id=%s&display=false"><span class="small">(hide)</span></a>
        <a href="/comment?main_id=%s"><span class="small">(comments)</span></a></td>
        <td><a href="/tc?url=%s&main_id=%s&user_tag_list=%s" title="edit tags">%s</a>
        </td>
        </tr>
        """ % tuple([item.url, item.title, urlparse(item.url).netloc,
        f1.truncate_at_space(item.pitch), main_id, main_id, main_id,
        item.url, main_id, (", ".join(item.tag_list)),
        (", ".join(item.tag_list)),]))


    self.response.out.write("""</tbody></table>""")    
  • 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-05-26T05:16:40+00:00Added an answer on May 26, 2026 at 5:16 am

    First thing, you have false as a class in your HTML

    <a class="false" href=...

    and an ID in your script

    $("#false").click(function()...

    Your hide is also an id and should be class.

    Here is the fix: http://jsfiddle.net/A6jKm/1/


    EDIT

    now it hides the entire table

    That’s because all your rows are generated with the same hide class, as seen here

    for item in e:
        main_id = item.key().id()
        self.response.out.write("""
        <tr class="hide">
    

    To get around this, I’ve modified the code a bit to search for the direct parent of the clicked item:

    $("a.false").click(function(e){
        $(this).parents('tr').hide();
        e.preventDefault();
    });
    

    Updated Example: http://jsfiddle.net/A6jKm/3/


    EDIT 2

    Perhaps closest would work better.

    Try this

    $("a.false").click(function(e){
        $(this).closest('tr.hide').hide();
        e.preventDefault();
    });
    

    Example 3: http://jsfiddle.net/A6jKm/4/

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

Sidebar

Related Questions

I'm following this tutorial: http://www.javascripttoolbox.com/jquery/ And I'm trying to get table rows that are
I'm currently trying to hide a dynamically created table row after a button has
I'm trying to add a row to a table and have that row slide
I'm trying to emit some jQuery and other Javascript that will hide and show
I have a table that looks something like this: <table> <tr id=header> <th>Title</th> <th>Title</th>
I'm trying to user JQuery to make a table row clickable and redirect to
I am trying to figure out the way to edit a row of table
I have a question about usability/design. I currently am using some JQuery to hide/show
I'm trying to hide tr's within a html table if the inputs inside them
I have a simple hide show jquery script I grabbed from an example site.

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.