HTML className is not spec'd to be page-unique, so there is no such  
concept as "get the one element with this className". The DOM function  
is document.getElements.ByClassName (note the plural), and returns an  
array -- even if there's just one such on the page. Likewise the  
Prototype double-dollar always returns an array, maybe even an empty  

So you have to use one of the Iterator functions to apply the desired  
transformation to each element of the array. In your case, I would use  
invoke, since it's very fast.



On Apr 24, 2009, at 8:30 AM, wrote:

> Hello,
> i need a function witch removes an selector and his elements inside.
> It works well with id like this:
> $('mutsu').remove();
> but it wont work with class name.
> I tried:
> $$('.className').remove();
> and
> document.getElementByClassName('className').remove();
> It return always:
> $('.className') has no properties
> Do anyone know how i select a selector with a class?

You received this message because you are subscribed to the Google Groups 
"Prototype &" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to