Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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

Save Automatically?

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

              
                <select class="parent" name="foo">
<option value="" selected="selected">地方を選択</option>
<option value="北海道・東北">北海道・東北</option>
<option value="関東">関東</option>
<option value="甲信越・北陸">甲信越・北陸</option>
<option value="九州・沖縄">九州・沖縄</option>
</select>
<select class="children" name="bar">
<option value="" selected="selected">都道府県を選択</option>
<option value="北海道" data-val="北海道・東北">北海道</option>
<option value="青森県" data-val="北海道・東北">青森県</option>
<option value="岩手県" data-val="北海道・東北">岩手県</option>
<option value="宮城県" data-val="北海道・東北">宮城県</option>
<option value="秋田県" data-val="北海道・東北">秋田県</option>
<option value="山形県" data-val="北海道・東北">山形県</option>
<option value="福島県" data-val="北海道・東北">福島県</option>
<option value="茨城県" data-val="関東">茨城県</option>
<option value="大分県" data-val="九州・沖縄">大分県</option>
<option value="宮崎県" data-val="九州・沖縄">宮崎県</option>
<option value="鹿児島県" data-val="九州・沖縄">鹿児島県</option>
<option value="沖縄県" data-val="九州・沖縄">沖縄県</option>
</select>

              
            
!

CSS

              
                
              
            
!

JS

              
                $(function(){
  $('.parent').on('change',function(){
    var v=$(this).val();
    $('.children').prop('disabled',v=="").val("");
    $('.children option:gt(0)').hide().filter('[data-val="'+v+'"]').show();
  }).trigger('change');
}); 

              
            
!
999px

Console