How to create listeners with javascript
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need to create a main class animal , then have two sub classes inherit properties from animal which are cat and dog , then I was to make multiple objects (multiple cat's and dog's) inherit from the class cat and dog (I read it's not really a class but it behaves as a class). The multiple objects (cat1, mycat, tomcat, dog1, mydog, topdog) need to be able to talk and listen to each other. When talking I would have them just alert or print a text line. What I am having trouble with is the listening part. I want the individual myDog to print