0

How can i access the element that was calling the event?

For example: If i click on an input element, it calls the onfocus eventhandler. The method should change the elements backgroundcolor. Is there some way to access it directly without getElementById? With parameters?

19th Apr 2017, 10:22 AM
Fleischsalat
1 Answer
0
getElementById seems to be the most direct way of access. Other methods that exist include getElementsByTagName and getElementsByClassName.
19th Apr 2017, 10:30 AM
Daniella
Daniella - avatar