javascript - Wrap an element in MooTools with custom class -


Mootools में, क्या यह निम्नलिखित करना संभव है:

  var MyClass = new class ({प्रारंभ: फ़ंक्शन (एल) {this.element = document.id (el);}}); Console.log (उदाहरण (document.id ('test-div'), एलिमेंट); // logs: 'true' var instance = new MyClass ('test-div'); console.log (instanceOf (उदाहरण, MyClass) ; // अपेक्षित परिणाम: 'सच' console.log (उदाहरण (दस्तावेज़ .id ('test-div'), MyClass); // अपेक्षित परिणाम: 'सच्चा'  

अन्य में शब्दों, यदि मेरी कक्षा किसी तत्व पर तत्काल बोलती है, तो उसे "एलिमेंट" के बजाय "मायक्लास" वापस करना चाहिए


Comments

Popular posts from this blog

Active Directory Authenticated Proxy Server with Squid or CNTLM -

java - Can't add JTree to JPanel of a JInternalFrame -

java - @PluginTarget(Node.class) not registering as neo4j plugin -