No need for the case insensitive since tagName always returns uppercased
values.




Fábio Miranda Costa
Solucione Sistemas
Front-End Engineer
http://meiocodigo.com


On Thu, Jul 9, 2009 at 12:28 PM, Jan Kassens <[email protected]> wrote:

> you forgot the `i` flag for case insensivity:
>
> Selectors.Pseudo.headers = function() {
>   return this.tagName.test(/^H[1-6]$/i);
> }
> BTW: this.get(attr) doesnt work for pseudo selectors cross-browser, because
> the elements are not extended (in IE). Use Element generics instead, for
> example: Element.get(this, attr). Which works on vanilla elements even in
> IE.
>
> Jan
>
>
> On 7. Jul, 2009, at 21:06, Fábio M. Costa wrote:
>
> sorry:
>
> Selectors.Pseudo.headers = function() {
>   return this.tagName.test(/^H[1-6]$/);
> }
>
>
> Fábio Miranda Costa
> Engenheiro de Computação
> http://meiocodigo.com
>
>
> 2009/7/7 Fábio M. Costa <[email protected]>
>
>> Selectors.Pseudo.headers = function() {
>>   return this.tagName.test(/^h[1-6]$/);
>> }
>>
>> Fábio Miranda Costa
>> Engenheiro de Computação
>> http://meiocodigo.com
>>
>>
>>
>> On Tue, Jul 7, 2009 at 3:53 PM, Perrin Perrin 
>> <[email protected]>wrote:
>>
>>> Selectors.Pseudo.headers = function() {
>>>   return this.get('tag').test(/h\d/);
>>>
>>> }
>>>
>>> On Tue, Jul 7, 2009 at 1:47 PM, theiviaxx <[email protected]> wrote:
>>>
>>>>
>>>> Selectors.Pseudo.headers = function() {
>>>>    return this.get('tag') == "h1" || this.get('tag') == "h2" ||
>>>> this.get('tag') == "h3" || this.get('tag') == "h4" || this.get('tag')
>>>> == "h5"  ||this.get('tag') == 'h6'
>>>> }
>>>>
>>>> thanks for the link :)
>>>>
>>>> On Jul 7, 9:45 am, Thierry bela nanga <[email protected]> wrote:
>>>> > this looks like custom selector,
>>>> > look mootools examples athttp://
>>>> davidwalsh.name/mootools-pseudo-selectors
>>>> >
>>>> > <http://davidwalsh.name/mootools-pseudo-selectors>
>>>> >
>>>> > On Tue, Jul 7, 2009 at 5:40 PM, TheIvIaxx <[email protected]>
>>>> wrote:
>>>> >
>>>> > > Is there any way to do this in mootools?  jquery has $(':header').
>>>> > > just wondering if mootools has something similar
>>>> >
>>>> > --
>>>> > fax : (+33) 08 26 51 94 51
>>>>
>>>
>>>
>>
>
>   --
> Jan - MooTools comitter
> twitter/blog: http://kassens.net
>
>

Reply via email to