"data-target" is don't work Bootstrap4.
This is Bootstrap4 version.
<!doctype html>
<html lang="ja">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<title>Hello, world!</title>
</head>
<body>
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="active"><a href="#home" data-toggle="tab" data-target="#home, #home_else" aria-selected="true" id="home_tab">Home</a></li>
<li><a href="#profile" data-toggle="tab" data-target="#profile, #profile_else" aria-selected="false" id="profile_tab">Profile</a></li>
<li><a href="#messages" data-toggle="tab" data-target="#messages, #messages_else" aria-selected="false" id="messages_tab">Messages</a></li>
<li><a href="#settings" data-toggle="tab" data-target="#settings, #settings_else" aria-selected="false" id="settings_tab">Settings</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="home" aria-labelledby="home_tab" role="tabpanel">...1</div>
<div class="tab-pane" id="profile" aria-labelledby="profile_tab" role="tabpanel">...2</div>
<div class="tab-pane" id="messages" aria-labelledby="messages_tab" role="tabpanel">...3</div>
<div class="tab-pane" id="settings" aria-labelledby="settings_tab" role="tabpanel">...4</div>
</div>
<div class="tab-content">
<div class="tab-pane active" id="home_else" aria-labelledby="home_tab">...11</div>
<div class="tab-pane" id="profile_else" aria-labelledby="profile_tab">...22</div>
<div class="tab-pane" id="messages_else" aria-labelledby="messages_tab">...33</div>
<div class="tab-pane" id="settings_else" aria-labelledby="settings_tab">...44</div>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<script>
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
var activated_tab = e.target // activated tab
var previous_tab = e.relatedTarget // previous tab
if(activated_tab.id === 'home_tab') {
$('#home_else').css('display', 'block');
$('#profile_else').css('display', 'none');
$('#messages_else').css('display', 'none');
$('#settings_else').css('display', 'none');
};
if(activated_tab.id === 'profile_tab') {
$('#home_else').css('display', 'none');
$('#profile_else').css('display', 'block');
$('#messages_else').css('display', 'none');
$('#settings_else').css('display', 'none');
}
if(activated_tab.id === 'messages_tab') {
$('#home_else').css('display', 'none');
$('#profile_else').css('display', 'none');
$('#messages_else').css('display', 'block');
$('#settings_else').css('display', 'none');
}
if(activated_tab.id === 'settings_tab') {
$('#home_else').css('display', 'none');
$('#profile_else').css('display', 'none');
$('#messages_else').css('display', 'none');
$('#settings_else').css('display', 'block');
}
// 処理,,,,,
});
</script>
</body>
</html>