css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              都道府県<br>
<input id="gcTextBox">

<div id="prefecture">
  <table>
    <tr>
      <th>北海道</th>
      <td><span>北海道</span></td>
    </tr>
    <tr>
      <th>東北</th>
      <td><span>青森県</span><span>岩手県</span><span>宮城県</span><span>秋田県</span><span>山形県</span><span>福島県</span></td>
    </tr>
    <tr>
      <th>関東</th>
      <td><span>茨城県</span><span>栃木県</span><span>群馬県</span><span>埼玉県</span><span>千葉県</span><span>東京都</span><span>神奈川県</span></td>
    </tr>
    <tr>
      <th>甲信越</th>
      <td><span>山梨県</span><span>長野県</span><span>新潟県</span></td>
    </tr>
    <tr>
      <th>北陸</th>
      <td><span>富山県</span><span>石川県</span><span>福井県</span></td>
    </tr>
    <tr>
      <th>東海</th>
      <td><span>岐阜県</span><span>静岡県</span><span>愛知県</span><span>三重県</span></td>
    </tr>
    <tr>
      <th>近畿</th>
      <td><span>滋賀県</span><span>京都府</span><span>大阪府</span><span>兵庫県</span><span>奈良県</span><span>和歌山県</span></td>
    </tr>
    <tr>
      <th>中国四国</th>
      <td><span>鳥取県</span><span>島根県</span><span>岡山県</span><span>広島県</span><span>山口県</span><span>徳島県</span><span>香川県</span><span>愛媛県</span><span>高知県</span></td>
    </tr>
    <tr>
      <th>九州</th>
      <td><span>福岡県</span><span>佐賀県</span><span>長崎県</span><span>熊本県</span><span>大分県</span><span>宮崎県</span><span>鹿児島県</span></td>
    </tr>
    <tr>
      <th>沖縄</th>
      <td><span>沖縄県</span></td>
    </tr>
  </table>
</div>
            
          
!
            
              body { 
  font-family:sans-serif; 
  font-size:14px; 
}

#prefecture table {
  background-color: azure;
  border: darkgray 1px solid;
  border-radius: 5px;
}
#prefecture th {
  padding: 0 0.5rem;
  border-right: steelblue  2px solid;
  font-weight: bold;
}
#prefecture span {
  margin: 0 0.5rem;
  color: blue;
  cursor : pointer;
}
            
          
!
            
              GC.InputMan.LicenseKey = "GrapeCity-Internal-Use-Only,*.s.codepen.io,E533581452858357#B03U4I5SKhnY4JWcTpkNnRVbjNlQBdzaPxkYqFDNyMnNxZnNklmW6d5NiZ4cyMXZmtUNqlzYZhDNVBFan5kW896arhURSF7UrdVdhtWS8dHersyZWlEWShUQPNzZrIzRSdlTWFDd6I5dTFTZOVHTJJEMphHZwBTTFRkcsllY4VEezpWR5lkbVlTehVDNXpmelZzS79GW0N6ToV5bzBjZvo6SLJTTNtmbnxGVLp7RkZ7LuFDRGllbtV6byc4aKJWQOJlSiFmeycjYYd6QSxmV4BzK9InasR4UsVUNHdlM4BlNtxWdws6KrRFZOVERwcUYKdlI0IyUiwiIDhjR5kjRDNjI0ICSiwSMzMzN6IDM4MTM0IicfJye#4Xfd5nIKl4S9IiOiMkIsIiM6ByUKBibh5Ed5BnbJJiOi8kI1tlOiQmcQJCLiYDN4ADOwACNwATM8EDMyIiOiQncDJCLi2Wau8WZwVGZvNmLz9iKiojIz5GRiwiI+S09ayL9Pyb9qCq9jK88GO887K88XO882O88sO88wK88iojIh94QiwSZ5JHd0ICb6VkIsIyN5MDO5gjM5QTM8UzMzUjI0ICZJJye0ICRiwiI34TUyxkVMlFNJ9UW9FFO7pEc4MVatVkVEJFdZBXMDNWVFZ7dDR6MGRUaoFGcX3kU8p6LCJ6KhpENnZXcJ94NkRmcxUUb9olVlRXd4VVOhJkVtNDNSRUWpFGOqB7RRhzbwgzcxUZU5h"

var gcTextBox = new GC.InputMan.GcTextBox(document.getElementById('gcTextBox'),{
  format:'Z'
});

var gcDropDown = gcTextBox.createDropDown();
gcDropDown.getElement().appendChild(document.getElementById('prefecture'));
document.getElementById('prefecture').addEventListener('click', function (e) {
  if (e.srcElement.tagName.toLowerCase() == 'span') {
    gcTextBox.setText(e.srcElement.innerText);
    gcDropDown.close();
  }
});
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console