Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prototype setting styles on an element

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

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

From everything that I have researched, this is the correct syntax. So I am not sure what I am doing wrong. Any help with this is greatly appreciated.

like image 404
rottmanj Avatar asked Jan 20 '23 12:01

rottmanj


1 Answers

You need to use each()

$$('#cartov .overlay-login-display').each(function(ele) {
  ele.setStyle({display: 'none'})
});
like image 108
John Conde Avatar answered Feb 01 '23 11:02

John Conde