最初にページの周りのさまざまなコンテンツを非表示にするために...
$('#objective_details, #time_estimate_details, #team_members_details, #resources_details').hide();
のようなワイルドカードを行う方法はありますか
$('#*_details').hide();
最初にページの周りのさまざまなコンテンツを非表示にするために...
$('#objective_details, #time_estimate_details, #team_members_details, #resources_details').hide();
のようなワイルドカードを行う方法はありますか
$('#*_details').hide();
CSS クラスを使用します。「details」を含む各タグまたは要素に対して、クラスを適用します。
<p class="details"> ... </p>
<div class="details"> ... </div>
<section class="details"> ... </section>
次に、次のようにします。
$('.details').hide();
$('[id$=_details]').hide();
jQuery('div[id$="_details"]'); // faster I suppose
// Following also works using "." (-may be as of only jQuery 1.6 +)
jQuery('div.[id$="_details"]')