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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:51:22+00:00 2026-06-04T22:51:22+00:00

I have a table in my page as below. <table id=tbl> <tr> <td class=field

  • 0

I have a table in my page as below.

<table id="tbl">
  <tr>
    <td class="field" id="field1s">field1x</td>
    <td class="field" id="field2s">field2x</td>
    <td class="field" id="field3s">field3x</td>
    <td class="field" id="field4s">field4x</td>
    <td class="xx">#</td>
    <td class="yy">#</td>
  </tr>
</table>

The texts of fields in row change into inputs on <td class="xx"> field and get updated on next click. This works fine. But I want the class xx change to aa and yy to bb when user first click <td class="xx">#</td>. Then the field may change to inputs, enabling user to change text. If user again click <td class="aa">#</td> (previously <td class="xx">#</td>), the text in row may be updated and if user click <td class="bb">#</td> (previously #), the row may go back to previous state. (Just like OK and CANCEL).

Here is the fiddle.

How can I do this? I prefer a simpler and faster solution.

  • 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-04T22:51:24+00:00Added an answer on June 4, 2026 at 10:51 pm

    If you’d like to keep your classes, try this fiddle.

    I’ve used event delegation .live() to keep consistency with your class changes.

    The .toggle should be removed to prevent some bugs – e.g. in thecodeparadox’s answer, if you click the edit button followed by cancel button, the next click in the edit button will fire the wrong function.

    Just don’t forget to replace .live() by .on() if you’re using jQuery 1.7+ in your page.

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

Sidebar

Related Questions

I have a table in my page as below; <table id=tbl cellpadding=0 cellspacing=0 style=width:
I have the following table in my page <table> <tr class=evenPack> </tr> <tr class=evenSubPack>
I have a html page as below: <div id=test1> <table> <tr> <td><span id=234>ABKO</span></td> </tr>
I have a page with a fixed header and below that a table that
I have this page table below and I want to remove the numbering prefix
I have a db with two tables like these below, page table pg_id title
I have a <code>rich:extendedDataTable</code>. Each row has a a4j:commandLink as below. Table Page: <a4j:commandLink
I have a table like this below, Field Type Collation Attributes Null Default cde_id
In the code below (jsf page), i have some hotel info in display:table rows
I have an html table rendered page and I want to save it as

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.