如果我这样做......
$('.class1, .class2').hide();
Run Code Online (Sandbox Code Playgroud)
然后将隐藏具有class1或class2的所有项目.
<pre class='class1'>hello1</pre>
<pre class='class2'>hello2</pre>
<pre class='class1 class2'>hello3</pre>
Run Code Online (Sandbox Code Playgroud)
什么是语法,所以只有第3个<pre>将被隐藏,我想隐藏基于它们同时具有class1和class2的东西.