Raio was an example. I know its just an input element which is why i was 
asking.  Something like 

$$("input[type=radio]").implement({
        style : function () {}
        });

Is what i was hoping to be able to do

-----Original Message-----
From: Sanford Whiteman [mailto:sa...@cypressintegrated.com] 
Sent: Friday, 15 July 2011 5:55 PM
To: mootools-users@googlegroups.com
Subject: RE: [Moo] Element.implement

Well, specifically targeting radios this way will never be possible, because 
they are just an HTMLInputElement with a specific `type` value (there is no 
HTMLRadioElement). So there's that.

Even when browsers allow you to extend the subinterfaces of HTMLElement, you 
are still restricted to the standard subinterfaces.  So you can't extend radios 
or checkboxes separately, and you shouldn't even expect to extend <EM> and 
<STRONG> or even <SPAN> tags individually, since per the DOM specs, all these 
hang directly off the generic HTMLElement. 

In sum, even in cutting-edge browsers, you may have to check the current 
element's tag and/or type before continuing, so for simplicity you might as 
well extend the whole Element. I'd guess that with a _extremely_ high ratio of 
uninteresting elements to your "interesting" elements, you might actually see 
that extending, say, just HTMLInputElement would be faster at runtime, but it's 
unlikely to be worth it.

-- S.

Reply via email to