The document PropertyThe document property holds the document object that contains the object. You can see the support for this property in Table 5.20. Table 5.20. The document Property
Here's an example; in this function, warner , I'll use an object's document property to write a warning message about the object to the object's document (the isBad method is fictitious): function warner(object1) { if(object1.isBad()){ object1.document.write("WARNING: Bad Object Found!") } } |