开发者

Is there an easy way to use prototype show hide functions on array of html elements

开发者 https://www.devze.com 2023-01-14 16:04 出处:网络
I noticed that you can\'t use the show function on an array of html elements like the list of elements returned when you apply a document.getELementsByClassName call. For which I have to make a little

I noticed that you can't use the show function on an array of html elements like the list of elements returned when you apply a document.getELementsByClassName call. For which I have to make a little loop and apply the show/hide开发者_如何学Python or any other extended dom function to the individual elements.

If there an easy way to do this in prototype without having to go through a loop? Just asking.


Try invoke

myArray.invoke('show');

Or you can use each

0

精彩评论

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