M
M
mrzgt2020-02-03 13:33:53
Bootstrap
mrzgt, 2020-02-03 13:33:53

How to perform an action for the first active tab when entering the site and then when you click on it?

Got bootstrap tabs

<div class="tab-content">
  <div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">...</div>
  <div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">...</div>
  <div class="tab-pane fade" id="messages" role="tabpanel" aria-labelledby="messages-tab">...</div>
  <div class="tab-pane fade" id="settings" role="tabpanel" aria-labelledby="settings-tab">...</div>
</div>


As when entering the site for the first active tab and then when you click on it, perform an action, for example alert("text");

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mahmudchon, 2020-02-03
@mahmudchon

There is documentation about this, see the section Events (Events)
https://getbootstrap.com/docs/4.4/components/navs/...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question