在jQuery中,使用相同的类设置spans来显示:inline from:block

时间:2022-05-18 20:37:32

Using jQuery, is there a way to select all tag that reference a specific css class, and set the display to "inline"?

使用jQuery,有没有办法选择引用特定css类的所有标记,并将显示设置为“内联”?

example:

<span class="theclass">junk</span>
<span class="theclass">other junk</span>
<span class="theclass">more junk</span>

in .css:

.theclass {
    display: none;
}

1 个解决方案

#1


5  

$(".theclass").css("display", "inline");

or maybe

$(".theclass").show();

#1


5  

$(".theclass").css("display", "inline");

or maybe

$(".theclass").show();