Use onchange in a div
No; the onchange
attribute is only applicable to form field elements (input
, select
, textarea
, etc).
Since you say you're using AJAX, why not execute the function when you update the text. I'm not sure if you use any library, but in case it's jQuery just do:
$.ajax({ ...,
success: function() {
... other things ...
... setting div text ...
calculateTotal();
}
});