JS multiple elements modify the same attribute

$('.field0, .field1, .field2').css('display', 'none'); 

Note : $ ('') quotes contain all the elements inside, not $ ('. Field0', '.field1', '.field2'). Such a pair of quotes encloses an element, a common mistake

Guess you like

Origin www.cnblogs.com/pyspang/p/12681466.html