i need to write a function onchange of some attribute, but when i wrote the following
$("#handle_valueAA").attr("aria-valuenow").change(function(u)
{
...
})
it doesn't work. what is the reason?
Thanks
i need to write a function onchange of some attribute, but when i wrote the following
$("#handle_valueAA").attr("aria-valuenow").change(function(u)
{
...
})
it doesn't work. what is the reason?
Thanks
The change event fires when the user changes the value of a form control.
It isn't a generic event that can be associated with an attribute so it will fire when JS changes that attribute. There is nothing (at least nothing that sees wide support) that can do that.
You will either need to modify whatever functions change the attribute, or use setInterval to poll the attribute looking for changes.
The reason is simple. The change event is supported for form elements only - it will not work on attributes. If you want to catch attribute modifications you need to look into the DOM mutation event DOMAttrModified and the IE proprietary event onpropertychange.