php – How to check a variable Changes

I have a variable $curr_price. Every time some user update the the variable, I want to show a message to the other users.

Should I use a jQuery script something like this: ”’$(“input”).change(function(){
alert(“The Price has been changed.”);
});”’

And secondly where in my php file should I put the script. In the top of the document or where I want the message to be displayed. I actually don’t want to use an alert box but echo or print the messages n a specific div