Search code examples
htmlzurb-foundation-5

Default select button in foundation group button


When my page is loading, I want to select an item automatically on my button group but I can't find the Foundation class to use.

<div class="button-bar">
        <ul class="button-group">
              <li><a href="#" class="small button">date</a></li>
              <li><a href="#" class="small button">site</a></li>
        </ul> 
</div>

This post speaks about Zurb-Foundation 4 ! Do you known if something has changed in Zurb-Foundation 5 ?

Thanks


Solution

  • The solution is to use an :focus tag in CSS

    .button-group li a:focus {
        background-color: red;
    }
    

    And the Javascript code to focus on the link

    $('.button-group li a').get(0).focus()
    

    Thanks to @Bass Jobsen