Jump to content

How to run function on div value change?


dlebowski

Recommended Posts

Hi.  I have a div that changes it's value using AJAX.  For example, <div id=name> .  Is it possible for me to run a javascript function every time that value changes?  So if the value of id=name is "3" and ajax changes it to "4", the value displayed in the browser has changed, but I also want it to run a function().  Is this possible?  Thank you in advance.

 

Ryan

 

Link to comment
https://forums.phpfreaks.com/topic/192212-how-to-run-function-on-div-value-change/
Share on other sites

If you're not using jquery I don't think there is a way around it other than storing the old value and running a check with setInterval every x (or 0.x) seconds. (which is probably what jquery does as well if it it support it on anything beyond fileUpload, select, text (input type="text") and textareas.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.