Answer the question
In order to leave comments, you need to log in
How to change button name when opening/closing accordion?
<?php if (Db::$count_sql): ?>
<button class="font-weight-bold text-success" data-toggle="collapse" data-target="#query">
Открыть запросы
</button>
<div class="collapse" id="query">
<div class="text-primary">
<ol class="m-0">
<?php foreach (Db::$queries as $query): ?>
<li><?= $query ?></li>
<?php endforeach; ?>
</ol>
</div>
</div>
<?php endif; ?>
Answer the question
In order to leave comments, you need to log in
$('#query').on('shown.bs.collapse', function () {
$('<button data-target="#query"'>).text('Закрыть запросы')
})
$('#query').on('hidden.bs.collapse', function () {
$('<button data-target="#query"'>).text('Открыть запросы')
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question