Styles of prototype styles on an element

In my prototype class, I have a loginSuccess function. In this function, I have this bit of code $$('#cartov .overlay-login-display').setStyle({display: 'none'});

What I expected from this is to hide the div. However, I get this exception: Exception : TypeError: $$("#cartov .overlay-login-display").setStyle is not a function

Of all that I researched, this is the correct syntax. Therefore, I am not sure what I am doing wrong. Any help with this is much appreciated.

+4
source share
1 answer

You need to use each()

 $$('#cartov .overlay-login-display').each(function(ele) { ele.setStyle({display: 'none'}) }); 
+9
source

All Articles