<div class="navbar navbar-default">

    <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="sr-only">+</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
    </div>
    <div class="navbar-collapse collapse">
        <ul class="nav navbar-nav">
            [repeat]
            <li>
                <a [attr] href="[path]">[caption]</a>
            </li>
            [/repeat]
        </ul>
    </div>

</div>
<script>
    $('.nav li').click(function () {
        $('.nav li').attr('class', '');
        $(this).addClass('active');
    })
</script>