I've a HTML page with several Div's that will show the time difference between now and each given date.
<div class="dated" onEvent="calculateHTML(this, 'Sat Jun 09 2007 17:46:21')">
30 Minutes Ago</div>
I want that time difference to be dynamic (calculated to all elements when the page loads and also within a time interval)
So, my idea was to go to all div's of class "dated", calculate the time diference for each one and replace the correspondent innerHTML.
Is this the best aproach or should I try a different one?
Edit:
One of the problems I've encountered was, where do I keep within the div, the date that will be used to generate the text?