I have a span with some value:
<li>Rent Collected: Euros <span id="rentTotal">2000</span></li>
I need the value to be update whenever user does any action in the page. Is there a way to do it without using onclick on all the elements?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming this is using form elements to enter info, the form.onchange event is pretty handy for recalculations like that.
If you are not using form elements but instead using just HTML and lots of onclick code … then this is why you should be using form elements instead.