?
Solved

Javascript object onClick reference another object's onclick

Posted on 2007-12-05
3
Medium Priority
?
1,690 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
raj3060 earned 500 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
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…
Suggested Courses

765 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