How do I store two element id's from onmousedown and onmouseup as variables
<p>I simply want to store the element.id from an <code>onmousedown</code> event and then store the element.id on the adjacent <code>onmouseup</code> event.</p>

<p>I'd like to do it within the same function so I can pass both variables with the window.location method to a subsequent webpage.</p>

<p>Seems easy enough.  I've struggled with fromElement and toElement and srcElement, but can't seem to get these things to work.</p>

<p>I'd love some suggestions or some code!</p>

<p>Here's the basic HTML:</p>

<pre><code>&lt;html&gt;
   &lt;head&gt;
      &lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type" /&gt;
      &lt;title&gt;Movable Test Environment&lt;/title&gt;

      &lt;script type="text/javascript"&gt;&lt;/script&gt;
   &lt;/head&gt;
   &lt;body&gt;
      &lt;div&gt;
         &lt;table border="1"&gt;
            &lt;tr&gt;
           &lt;td id="Start"&gt;From Here&lt;/td&gt;
           &lt;td&gt;More Table Data&lt;/td&gt;
           &lt;td&gt;Even More Table Data&lt;/td&gt;
            &lt;/tr&gt;
         &lt;/table&gt;
      &lt;/div&gt;
      &lt;br/&gt;&lt;br/&gt;
      &lt;div&gt;
         &lt;span id="Finish1"&gt;To Here&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;
         &lt;span id="Finish2"&gt;Or To Here&lt;/span&gt;
      &lt;/div&gt;
   &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Update:  Solved.  Thanks.  The below tips worked.  I was just looking at it all wrong.</p>

<pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;

&lt;head&gt;
&lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type" /&gt;
 &lt;title&gt;Movable Test Environment&lt;/title&gt;

&lt;script type="text/javascript"&gt;
var to;
var from;
function putdown(a)
{
from=a;
alert(to+" "+from);
}
function pickup(b)
{
to=b;
}

&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;div&gt;
&lt;table border="1"&gt;
&lt;tr&gt;
    &lt;td id="Start" onmousedown="pickup(this.id)"&gt;From Here&lt;/td&gt;
    &lt;td&gt;More Table Data&lt;/td&gt;
    &lt;td&gt;Even More Table Data&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;

&lt;br/&gt;
&lt;br/&gt;

&lt;div&gt;
&lt;span id="Finish1" onmouseup="putdown(this.id)"&gt;To Here&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;
&lt;span id="Finish2" onmouseup="putdown(this.id)"&gt;Or To Here&lt;/span&gt;
&lt;/div&gt;
&lt;/body&gt;

&lt;/html&gt;
</code></pre>
