I was looking at some code on the web and couldn’t figure out what the purpose of the relatedObject property of a DOM object was:
this.hotspot = document.createElement('div');
this.hotspot.relatedObject = this;
Anyone have an idea?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This isn’t a standard property. It’s probably just a method of binding a JS object to a particular HTML element, for example to be able to retrieve the object easily in an event handler later on.