Answer the question
In order to leave comments, you need to log in
How to make such a selection?
Good day. The task was to select the first block with the .office_status class in the ofice block. I tried several options, but in all options there is a selection only in the first .office block
<div class="ofice data_103">
<div class="ofice_number"><div>Офис </div><strong>103</strong><hr></div><div>.............................</div>
<div class="ofice_status"><em>Типография ООО "КрафтПепер"</em></div>
<div class="ofice_status"><a href="http://xxxxx.ru/" target="_blank">xxxx.ru</a></div>
<div class="ofice_status">[email protected]</div>
<div class="ofice_status">8 (8882) 55-55-76</div>
<div class="are-us">
<div class="are">
<strong>Площадь</strong>
<div class="are-value">24 кв.м.</div>
</div>
</div>
<div class="price">
<div class="price-word">Цена</div>
<div class="price-value">5000р. кв.м.</div>
</div>
<a class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-lg">Подробнее</a>
</div>
<div class="ofice data_103">
<div class="ofice_number"><div>Офис </div><strong>103</strong><hr></div><div>.............................</div>
<div class="ofice_status"><em>Типография ООО "КрафтПепер"</em></div>
<div class="ofice_status"><a href="http://xxxxx.ru/" target="_blank">xxxx.ru</a></div>
<div class="ofice_status">[email protected]</div>
<div class="ofice_status">8 (8882) 55-55-76</div>
<div class="are-us">
<div class="are">
<strong>Площадь</strong>
<div class="are-value">24 кв.м.</div>
</div>
</div>
<div class="price">
<div class="price-word">Цена</div>
<div class="price-value">5000р. кв.м.</div>
</div>
<a class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-lg">Подробнее</a>
</div>
<div class="ofice data_103">
<div class="ofice_number"><div>Офис </div><strong>103</strong><hr></div><div>.............................</div>
<div class="ofice_status"><em>Типография ООО "КрафтПепер"</em></div>
<div class="ofice_status"><a href="http://xxxxx.ru/" target="_blank">xxxx.ru</a></div>
<div class="ofice_status">[email protected]</div>
<div class="ofice_status">8 (8882) 55-55-76</div>
<div class="are-us">
<div class="are">
<strong>Площадь</strong>
<div class="are-value">24 кв.м.</div>
</div>
</div>
<div class="price">
<div class="price-word">Цена</div>
<div class="price-value">5000р. кв.м.</div>
</div>
<a class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-lg">Подробнее</a>
</div>
$('.ofice .ofice_status:eq(0)').each(function(){
$(this).css('display','block');
});
Answer the question
In order to leave comments, you need to log in
I think it should be something like this:
$('.ofice .ofice_status').each(function(){
$(this).eq(0).css('display','block');
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question