I have a code which looks like this:-
<li><span id="readmon"></span></li>
I am changing the innerHTML of the above tag somehow and when it is changed I want to call a function, so I do a dojo.connect like this:-
dojo.connect(dojo.byId('readmon'),"onchange",netincome);
But I find that even though the innerHTML of the above changes, the function netincome is never called. Cant a change in innerHTML be found like this. If not , could someone please suggest a way.
To the best of my knowledge, there is no way to do that exactly as you would like to. I don’t think
onchangecan be applied to any element, only ones that the user can change. I think the best you can do would be to make a function to change theinnerHTMLand call thenetincomemethod from there:Then call this method whenever you need to change the
innerHTML.