[Javascript] RE: Invoke onclick event of one button from clicking a second button

George Tsang George.Tsang at senecac.on.ca
Tue Sep 10 21:17:22 CDT 2002


Thanks Harry for your help.
 
However, I had tried the same way you'd shown in the past and it did NOT
work on Netscape 6.
 
I tried again just now and it still does not work on my machine using
Netscape 6. (IE 5.5 works fine.)
 
If you know another way that works please let me know.
 
Thanks.
 
-----Original Message-----
From: javascript-admin at LaTech.edu [mailto:javascript-admin at LaTech.edu]
On Behalf Of George Tsang
Sent: Monday, September 09, 2002 4:59 PM
To: Javascript at LaTech.edu
Subject: [Javascript] Invoke onclick event of one button from clicking a
second button Greetings,
 
I have set up the following:
 
<button id="abutton" onclick="alert('A clicked')">A</button> 
<br> 
<button id="bbutton" onclick="stuff = document.getElementById
('abutton'); stuff.click()">B</button>
 
 
-----------------------
 
George,
 
You could try this:
<button id="bbutton"
onclick="document.getElementById('abutton').click()">B</button>
 
Works in Moz1.1.
 
Regards,
Harry
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20020910/2b6e986a/attachment.htm>


More information about the Javascript mailing list