I have a table on my page as shown 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 the fields in the line are changed to the entries in the <td class="xx">
field and are updated with the next click. It works great. But I want the xx
class to change to aa
and yy
to bb
when the user first presses <td class="xx">#</td>
. Then the field can be changed to inputs, allowing the user to change the text. If the user clicks <td class="aa">#</td>
again (previously <td class="xx">#</td>
), the text in the line can be updated, and if the user clicks <td class="bb">#</td>
(formerly #), the line may return to its previous state. (Same as OK and CANCEL).
Here is a violin.
How can i do this? I prefer a simpler and faster solution.
source share