Open next tab (label)

By carlosremove

I have the following combination of code:


  <div class="checkout">
    <input type="checkbox" id="cc" checked>
    <label for="cc">
        <div class="tab cc">
            <h3 class="tab__title">Credit Card<span class="fa fa-check"></span></h3>
            <div class="tab__content">
                <div class="input-group">
                    <input type="text" class="full cc-number" placeholder="Card Number">
                    <input type="text" class="expiry" placeholder="MM / YY"><input type="text" class="cvc" placeholder="CVC">
                    <input type="checkbox" id="remember"><label for="remember">Remember me</label>
                    <button type="button" class="button--action button--circle">GO</button>
    <input type="checkbox" id="agreement">
    <label for="agreement">
        <div class="tab agreement">
            <h3 class="tab__title">Agreement<span class="fa fa-check"></h3>
            <div class="tab__content">
                <div class="agreement__text">
                    <p>Kombucha offal kale chips semiotics, health goth shoreditch craft beer pickled occupy gentrify wayfarers franzen. Fanny pack crucifix jean shorts portland mumblecore chartreuse. Yr migas scenester, hoodie artisan fap chicharrones brunch ramps. Waistcoat venmo austin photo booth 90's affogato, viral craft beer readymade iPhone fashion axe. Cliche health goth cold-pressed cronut banjo selfies ennui synth locavore, etsy hoodie ethical. Synth everyday carry small batch, try-hard photo booth green juice tumblr farm-to-table normcore. Irony kinfolk fanny pack, beard scenester drinking vinegar asymmetrical man braid helvetica venmo chicharrones.
... More code


(function() {
    var tabs = $('.tab');
    tabs.on('click', function(e) {
        var checkbox = $(this).parents('label').prev();
        // Fix for all tabs collapsing when click is within the area taken up by a button
        if ( === 'BUTTON') {
            $(checkbox).prop('checked', true);
        // Don't collapse the currently open tab when clicked on
        if (':checked')) {
        // Allow only one tab to be open at a time
        checkbox.siblings('input:checkbox').prop('checked', false);

I also have some CSS but I don’t think it is extremely relevant. The code looks like it has different tabs and clicking in one will open it and close the one that is open. How can I make a bottom that opens the tab that is directly after? Each tab is

Source: Stack Overflow


Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273