0

Is there a quick way in javascript to select the element that called the function on an event such as onmouseover or onclick or do i have to use standard document selection in the method to select the element.

asked Sep 5, 2010 at 19:46

3 Answers 3

1

this

element.onclick = function () {
 // this == element
 // e.g. this.className = 'Highlighted';
}
Ujjwal Singh
5,0384 gold badges40 silver badges56 bronze badges
answered Sep 5, 2010 at 19:50
Sign up to request clarification or add additional context in comments.

Comments

1

check out this?

answered Sep 5, 2010 at 19:49

Comments

0

If I understand your question right then you should be able to use the "this" keyword.

answered Sep 5, 2010 at 19:49

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.