Prototype Hide All elements of a class
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
精彩评论