shafi_363
01-09-2006, 10:47 PM
Hi ALL,
According to definition of MouseUp event, i am supposed to get
the element ( if i use event.target or event.srcElement) whereever i
released my mouse. But in my case its not happening.
Here by i am attaching that html code. I tried out mousedown in
one list & the subsequent mouseup in another list.then also it
displaying the name of the first list box( where i had put my mousedown).
=============****** CODE START *******================
<HTML>
<HEAD>
<TITLE></TITLE>
<script type="text/javascript">
document.onmouseup = function(e)
{
alert(((e = e || event).target || e.srcElement).name);
};
</script>
</HEAD>
<BODY>
<form>
<table>
<tr>
<td>
<SELECT NAME=ONE MULTIPLE>
<OPTION>ONE_Web Authoring Reference</OPTION>
<OPTION>ONE_FAQ Archives</OPTION>
<OPTION>ONE_Design Elements</OPTION>
<OPTION>ONE_Tools</OPTION>
<OPTION>ONE_Feature Article</OPTION>
</SELECT>
</td>
<td>
<SELECT NAME=TWO MULTIPLE>
<OPTION>TWO_Web Authoring Reference</OPTION>
<OPTION>TWO_FAQ Archives</OPTION>
<OPTION>TWO_Design Elements</OPTION>
<OPTION>TWO_Tools</OPTION>
<OPTION>TWO_Feature Article</OPTION>
</SELECT>
</td>
</tr>
</table>
</form>
</BODY>
</HTML>
==================******CODE END *******===================
I want to get the target element whereever i released my mouse.( For
ex : if i put mousedown in list ONE & mouseup in list TWO, then in
mouseup event handler i should get "target.name" as "TWO"... But
currently it is giving as "ONE") ..Is there any other way to achieve
what i want...IF so please let me know :)
Thanks & Regards
--Shafi
According to definition of MouseUp event, i am supposed to get
the element ( if i use event.target or event.srcElement) whereever i
released my mouse. But in my case its not happening.
Here by i am attaching that html code. I tried out mousedown in
one list & the subsequent mouseup in another list.then also it
displaying the name of the first list box( where i had put my mousedown).
=============****** CODE START *******================
<HTML>
<HEAD>
<TITLE></TITLE>
<script type="text/javascript">
document.onmouseup = function(e)
{
alert(((e = e || event).target || e.srcElement).name);
};
</script>
</HEAD>
<BODY>
<form>
<table>
<tr>
<td>
<SELECT NAME=ONE MULTIPLE>
<OPTION>ONE_Web Authoring Reference</OPTION>
<OPTION>ONE_FAQ Archives</OPTION>
<OPTION>ONE_Design Elements</OPTION>
<OPTION>ONE_Tools</OPTION>
<OPTION>ONE_Feature Article</OPTION>
</SELECT>
</td>
<td>
<SELECT NAME=TWO MULTIPLE>
<OPTION>TWO_Web Authoring Reference</OPTION>
<OPTION>TWO_FAQ Archives</OPTION>
<OPTION>TWO_Design Elements</OPTION>
<OPTION>TWO_Tools</OPTION>
<OPTION>TWO_Feature Article</OPTION>
</SELECT>
</td>
</tr>
</table>
</form>
</BODY>
</HTML>
==================******CODE END *******===================
I want to get the target element whereever i released my mouse.( For
ex : if i put mousedown in list ONE & mouseup in list TWO, then in
mouseup event handler i should get "target.name" as "TWO"... But
currently it is giving as "ONE") ..Is there any other way to achieve
what i want...IF so please let me know :)
Thanks & Regards
--Shafi