Changing Title for several IDs with Javascript, calculating from original value
<p><br>My Code take the title of a TD tag in order to get the difference of time between
two time in a string<br>(ie. 13:01-14:03) and show it like a new title(property), this apply only for a only element, when I have more than one, it fails.<br>
How can I do it work for this case??</p>

<pre><code>&lt;table&gt;
    &lt;thead&gt;
        &lt;th&gt;First&lt;/th&gt;
        &lt;th&gt;Second&lt;/th&gt;
        &lt;th&gt;Third&lt;/th&gt;
        &lt;th&gt;Ok&lt;/th&gt;

    &lt;/thead&gt;
    &lt;tr&gt;
        &lt;td&gt;1&lt;/td&gt;
        &lt;td&gt;CCBB&lt;/td&gt;
        &lt;td class='huifa' id='calc' title='02-01-2013 13:01-14:03'&gt;231&lt;/td&gt;
        &lt;td class='huifa' id='calc' title='02-01-2013 13:01-13:53'&gt;1&lt;/td&gt;
    &lt;/tr&gt;

   &lt;tr&gt;
        &lt;td&gt;2&lt;/td&gt;
        &lt;td&gt;CCBB&lt;/td&gt;
        &lt;td&gt;342&lt;/td&gt;
        &lt;td&gt;0&lt;/td&gt;

    &lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>JS CODE</p>

<pre><code>&lt;script&gt;
element = document.getElementById('calc');
v = element.title
v = v.slice(11)
v = v.split('-')
totalTime = delTime(v[1],v[0]);
element.title = 'Duracion: '+totalTime
&lt;/script&gt;
</code></pre>

<p>My working code is here: <a href="http://jsfiddle.net/cespinoza/tg86a/55/" rel="nofollow">http://jsfiddle.net/cespinoza/tg86a/55/</a></p>

<p>Thanks.</p>
