Solved

Javascript object onClick reference another object's onclick

Posted on 2007-12-05
3
1,677 Views
Last Modified: 2012-05-05
In Java script, when I click on an object, it calls a function. But I actually need to run the function of another object because it passes the 'this' property of the object (I believe it's a DIV if that matters. So, when I click on object A, can I call object B's event?

ObjectA onClick=(ObjectB(onmouseup="DoSomething(this)")

Can I do that? Or, how can I get the 'this' of objectB to objectA's event?

Thanks in advance
0
Comment
Question by:niner
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
raj3060 earned 125 total points
ID: 20412065
Yes you can call Object B event from Object A by using document.getElementById('ObjectBid')
0
 

Author Comment

by:niner
ID: 20412321
Cool bean. Then, how do I call the function?

0
 
LVL 11

Expert Comment

by:raj3060
ID: 20412420
DoSomething(document.getElementById('ObjectBid').value)
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Glitching Slide Show 19 28
15 puzzle in Javascript/html 2 45
HTML editor custom button 3 60
Why am I getting ReferenceError:  boxes is not defined error 5 13
Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question