Twinkie
Banned
- Messages
- 1,389
- Reaction score
- 12
- Points
- 0
I am experimenting with object oriented javascript, and I ran into a simple problem. Within a method of an object called by an event, this does not reffer to the object but rather to the caller (in this case, an HTMLLIElement). How can I call another method within a method called by on onclick event?
Problem exemplified here. When I click on the open button, it can't call this.load() because this is referring to the li elements clicked. Any workarounds?
Problem exemplified here. When I click on the open button, it can't call this.load() because this is referring to the li elements clicked. Any workarounds?