Demo of Accordion active panel using JQuery UI

Header 1 ( panel No. 0 )

Text about Header 1

Header 2 ( panel No. 1 )

Text about Header 2

Header 3 ( panel No. 2 )

Text header 3

Header 4 ( panel No. 3 )

Text about Header 4.


By default the header 4 ( panel No 3 ) will be active
<html>
<head>
<title></title>
</head>

<div id='accordion'>
 <h3>Header 1 ( panel No. 0 )</h3>
  <div>
    Text about Header 1    
  </div>
 <h3>Header 2 ( panel No. 1 )</h3>
  <div>
    Text about Header 2    
  </div>
<h3>Header 3 ( panel No. 2 )</h3> 
  <div>
    Text header 3
  </div>
<h3>Header 4 ( panel No. 3 )</h3>
  <div>
    Text about Header 4.
   </div>
</div>

<script src='https://code.jquery.com/jquery-3.1.1.min.js'></script>
<script src='https://code.jquery.com/ui/1.12.1/jquery-ui.min.js'></script>
<link href='https://code.jquery.com/ui/1.12.1/themes/cupertino/jquery-ui.css' rel='stylesheet'>

<script>
$(document).ready(function(){
$( '#accordion' ).accordion({
active: 3
});
})
</script>
</body>
</html>