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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:53:14+00:00 2026-05-17T18:53:14+00:00

I trying to create an edit in place table cell. You click an edit

  • 0

I trying to create an “edit in place” table cell. You click an edit link, and a text area appears in its place. I also only want to display the edit link when I hover over the table row. The problem I’m having with the following code is that the edit link always appears when you hover over the table row. How can I make it so that the hiding/showing, only happens when you are not currently editing.

HTML:

<td><a class="edit">Edit</a> $100</td>

jQuery:

$(document).ready(function(){

    $('a.edit').hide();

    $('tr').hover(
        function(){
            $(this).find('a.edit').show();
        },
        function(){
            $(this).find('a.edit').hide();
        }
    );

    $('a.edit').click(function(e){
        e.preventDefault();
        $(this).hide();
        $(this).after('<input type="text" style="width:100%;" />');
    });
});
  • 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-17T18:53:15+00:00Added an answer on May 17, 2026 at 6:53 pm

    I’d probably do the hover in CSS. No need for javascript there. If you need to support IE6 with this feature, I’d make the javascript conditional.

    Then add a class to the <tr> in the click() handler when you create the <input>. The CSS can keep the link hidden for the <tr> with the class.

    Example: http://jsfiddle.net/gmS46/

    CSS

    tr a.edit {
        display:none;
    }
    tr:hover a.edit {
        display:inline;
    }
    tr.hasInput a.edit {
        display:none;
    }​
    

    jQuery

    $(document).ready(function(){
        $('a.edit').click(function(e){
            e.preventDefault();
            $(this).after('<input>').closest('tr').addClass('hasInput');
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a text edit in place myself just by manipulating jQuery
We are trying to create an edit in place kind of form. I'm using
I am trying to create a Edit text view in android, with arrow at
I am trying to break the table crutch... I want to place 3 labels,
Trying to create a black line in my view to separate text blocks but
I'm trying to create a link that pops open a new email in outlook:
I'm trying to create my keyboard, and now am at the place when the
I'm trying to immediately set a row to Edit mode after it is created.
I'm trying create a bot which automatically likes Facebook posts. Using Mechanize I can
I am trying create a delegate representation of constructor by emitting a Dynamic Method,

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.