[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1703
  • Last Modified:

Javascript object onClick reference another object's onclick

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
niner
Asked:
niner
  • 2
1 Solution
 
raj3060Commented:
Yes you can call Object B event from Object A by using document.getElementById('ObjectBid')
0
 
ninerAuthor Commented:
Cool bean. Then, how do I call the function?

0
 
raj3060Commented:
DoSomething(document.getElementById('ObjectBid').value)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now