Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <p class="input1 mB12"><input class="cInput1" type="serial" name="apply_serial" id="apply_serial" size="30" maxlength="14" placeholder="enter serial code here"><a href="#" id="jsSendSerial" class="jsBtnNextScene cBtn1 disabled" data-applyurl="/apply/emlogin.php">次へ</a></p>



					<p id="checkPolicy" class="mB36"><label><input class="cCheckbox1" type="checkbox">利用規約に同意</label><a href="#" id="jsApply" class="cBtn1 jsAgreeStatus disabled">次へ</a></p>

              
            
!

CSS

              
                
.cInput1,.cInput2 {
    padding:0 20px;
    height:100px;
    background:white;
    border:6px solid black;
    font-size:42px;
    vertical-align: top;
    width:496px;
}
.cInput2{
    width: 100%;
}

.cBtn1 {
    display:inline-block;
    width:170px;
    background:black;
    line-height:100px;
    text-decoration:none;
    text-align:center;
    color:#fff;
    font-size:18px;
    // font-weight:bold;
    vertical-align: top;
    // &:hover {
    //     background:#fff;
    //     color:black;
    // }
    &.disabled {
        cursor:default;
        pointer-events:none;
        filter: grayscale(75%) opacity(50%);
    }
}

.cRadio1 {
    margin-right:58px;
    width:0px;
    height:46px;
    position:relative;
    cursor:pointer;
    vertical-align:text-bottom;
    &:before,
    &:after {
        content:'';
        display:inline-block;
        position:absolute;
        left:0px;
    }
    &:before {
        width:46px;
        height:46px;
        top:9px;
        border:6px solid black;
        border-radius: 100%;
    }
    //チェックアイコン
    &:after {
        width:22px;
        height:22px;
        top:21px; left: 12px;
        background:gray;
        border-radius: 100%;
        transform:scale(0);
        transition: transform .2s ease;
    }
    &:checked:after {
        // display:block;
        transform:scale(1);
    }
}

.cCheckbox1 {
    margin-right:58px;
    width:0px;
    height:30px;
    position:relative;
    cursor:pointer;
    vertical-align:text-bottom;
    &:before,
    &:after {
        content:'';
        display:inline-block;
        position:absolute;
        left:0px;
    }
    &:before {
        width:30px;
        height:30px;
        top:7px;
        border:2px solid black;
        background:gray;
    }
    //チェックアイコン
    &:after {
        width:0px;
        height:25px;
        left: 10px;
        top:19px;
        overflow: hidden;
        // background:url(../images/common/ico_check.png) no-repeat left top;
        transition: width .3s;
        content:'✓';

        // display:none;
    }
    &:checked:after {
        width:25px;
        // display:block;
    }
}

              
            
!

JS

              
                        //注意事項確認まで選択させない
        $('#checkPolicy').find('.cCheckbox1').on('click', function(){
            if($(this).prop('checked')){
                $('.jsAgreeStatus').removeClass('disabled');
            }else{
                $('.jsAgreeStatus').addClass('disabled');
            }
        });
        //シリアル入力制御
        $('#apply_serial').on('keypress', function(){
            var result = insertSpace(this);
                console.log(result);
            (result >=13)?$('#jsSendSerial').removeClass('disabled'): $('#jsSendSerial').addClass('disabled');

        }).on('keyup', function(e){
            if(e.keyCode == 46 || e.keyCode == 8){ //del backspace→消しているのでボタンはおせないように
                if($(this).val().length < 14){
                    $('#jsSendSerial').addClass('disabled');
                }

            }else if(e.keyCode == 9|| e.keyCode == 13){
                var result = insertSpace(this);
                (result >=13)?$('#jsSendSerial').removeClass('disabled'): $('#jsSendSerial').addClass('disabled');
            }
        });

        // //チェックボックス択一
        // $('.jsMmStatus').on('click', function() {
        //     if ($(this).prop('checked')){
        //         $('.jsMmStatus').prop('checked', false);
        //         $(this).prop('checked', true);
        //     }
        // });
    // };

    //シリアルを入力中に4桁ごとにセパレーターを入れる
    var insertSpace = function(e) {
        if($(e).val()=='') return;
        var newVal, val;
        val = $(e).val().replace(/\x20/g, "");
        // newVal = val.replace(/(\d{4})/g, "$1 ");
        newVal = val.replace(/(.{4})/g, "$1 ");
        $(e).val(newVal);
        return newVal.length;
    };

              
            
!
999px

Console