Either add the
active
class to the first item in the markup:
<div class="accordion_wrap">
<div class="accordion_header active">
<h5>INFO</h5>
</div>
or add it via script:
$(function(){
$(".accordion_header").click(function() {
$(".accordion_header").removeClass("active");
$(this).addClass("active");
});
$(".accordion_header:first").addClass("active");
});
NB: Pay attention to the documentation:
jQuery offers several ways to attach a function that will run when the DOM is ready. All of the following syntaxes are equivalent:
$( handler )
$( document ).ready( handler )
$( "document" ).ready( handler )
$( "img" ).ready( handler )
$().ready( handler )
As of jQuery 3.0, only the first syntax is recommended; the other syntaxes still work but are deprecated.