开发者

Prototype Hide All elements of a class

开发者 https://www.devze.com 2023-01-14 18:13 出处:网络
I can show/hide with IDs, however how do I do it with classes? $(\'blac开发者_JAVA技巧k\').setStyle({

I can show/hide with IDs, however how do I do it with classes?

$('blac开发者_JAVA技巧k').setStyle({
  display:'none', border:'1px solid red'
});

For example that will work if I had #black, but what if I have .black?

Thanks,


Got it!

$$('.black').each(
   function (e) {
      e.setStyle({border:'1px solid red'}); 
   } 
);


Try:

$$('.black').setStyle({
  display:'none', border:'1px solid red'
});

More Info:

http://www.prototypejs.org/api/utility/dollar-dollar

0

精彩评论

暂无评论...
验证码 换一张
取 消