I have seen this example of collapse in w3school
You can use any accordion plugins to achieve this.
If you want to go with a small piece of code, go with this:
$('#btn1').click(function(){
$('.collapse').hide();
$('#demo').show();
});
$('#btn2').click(function(){
$('.collapse').hide();
$('#demo1').show();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="container" ng-app="myApp" ng-controller="customersCtrl">
<button type="button" class="btn btn-default" data-toggle="collapse" data-target="#demo" id="btn1" >Company Details</button>
<button type="button" class="btn btn-default" data-toggle="collapse" data-target="#demo1" id="btn2">Commercial Details</button>
<div id="demo" class="collapse" >
1st div
</div>
<div id="demo1" class="collapse">
2nd div
</div>
</div>
It sounds like using bootstraps accordion would give you the desired effects: http://getbootstrap.com/javascript/#collapse-example-accordion
It will allow you to collapse other divs when opening one, for instance.