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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.