Event handler for td?

Asked

Viewed 48 times

1

Guys, first a good day.

Well, I wonder if it is possible to create a handler in case a -td- is modified.

Example. I have the following code:

<table>
  <tr>
    <td>Olá</td>
  </tr>
</table>

When td is modified, activate an event handler. I tried to use .on('change'), but it seems to only work for inputs, textarea, check boxes...

I wonder if someone could help me?

Grateful from now on!

  • 3

    Can’t you use the code that modifies the table? It changes to?

  • Thanks for the answer. Well, I’m trying to create a Tampermonkey script, which takes information from a table. I would need an event handler if it is modified. But I don’t know what to do. Thanks again.

  • But, as a table, which is a "fixed" structure, will suffer a manipulation? Table displays formatted data, is not used for manipulation. Explain better what you want.

  • The information in this table is updated dynamically when you click on a button. I’d like to take the second row of this table. Do you understand? Thanks in advance.

  • Maybe a way to keep seeing the value from time to time with a "timer" will work. Hence if the value is different from the previous one, that is to say changed, then triggers the desired action.

  • Can’t you get the information in the same process that updates the table? Type, click the button, refresh the table and send the same data to where you need it?

  • Fleuquer, thanks for the answer. Well, I’m not the one who manages the system I’m scripting to, you know? Thanks in advance.

  • Rodrigo, thanks for the answer. Do you talk about using setInterval() for that? The idea seems good. I’ll try it here. Thanks in advance.

Show 3 more comments

1 answer

0


  • Thank you very much Diego. You solved my problem. Thanks again.

  • 1

    Glad to have helped! Good luck with the project! ;)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.