Barry - IMO what mootools (as well as other libs) does is create a wrapper for the element, with wanted methods (mootools does this for IE only). The uid is used to connect the element with the wrapper without modifying it
On Mon, Jan 17, 2011 at 2:33 AM, Barry van Oudtshoorn < [email protected]> wrote: > Hi Roman, > > jsFiddle is great for minimal examples. :) > > As far as I know, you can't actually extend Element in Internet Explorer. > What MooTools does is essentially a bit of jiggery-hackery: when you get an > element using document.id() (or its cousins), various properties are added > to the element (in the DOM) that provide you with access to the various > Element extensions. Take a look at this fiddle in IE: > http://jsfiddle.net/ygCcc/1/ You'll notice that the first block indicates > around 157 properties, whereas the second has 255. These extra ones are > courtesy of MooTools, and help make everything work nicely. (In other > browsers, you'll see that these counts are nearly identical -- the only > difference is the addition of a UID when accessing the element with > MooTools' methods.) > > This is why when you use document.id to "help out" the code, things will > start working correctly in IE. Without it, those elements aren't moo-ified. > > Hope this helps! > > -- > Barry van Oudtshoorn > www.barryvan.com.au > > Not sent from my Apple πPhone. > > -- Arieh Glazer אריה גלזר 052-5348-561 http://www.arieh.co.il http://www.link-wd.co.il
