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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                都道府県<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>
              
            
!

CSS

              
                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;
}
              
            
!

JS

              
                GC.InputMan.LicenseKey = "GrapeCity-Internal-Use-Only,E533581452858357#B0T8nyd92SaOJGMJRneVdXcXRlNrMGNnxUYoRVRrlVNNZ4Y4cTRYFUWyQmYlFzQ9lkTwFHdyUFTulFM5h7NiVUMhdVVyEkckJUO4VjVyVnQ8VTQkJkUDVUaKlEUzEWOn54V5VDdxc7dyVzSn5kaOVlZ4dWN7w4VJ96V6cVVRNDeVREWEtESrhzY4MkdiBTaxYnNvlGO8AVRvYEUjZGbw8EbKBVQDVFUyp5MNpFNywka5hjTENlcGNzURlzSWRDeZRHSFRESBpVcyM4LCJUV4JmWtNnYzcDTCNjTjZDMSlHcRRTcltCbxMUZzRnUwlmI0IyUiwiIEVENBdjQEdjI0ICSiwiM4YzN9UDM7ETM0IicfJye&Qf35VfioUSLljI0IyQiwiIyYHITpEIuFWT4VHculkI0IiTis7W0ICZyBlIsIyNyEzM5ADI5ITMxkTMwIjI0ICdyNkIsIybp9ibwR6YiojIz5GRiwiI+S09ayL9Pyb9qCq9jK88GO887K88XO882O88sO88wK88iojIh94QiwSZ5JHd0ICb6VkIsIyN5MDO5gjM5QTM8UzMzUjI0ICZJJye0ICRiwiI34TQMpnaBhWSkFVOBFkSQl6Rrl6LXZ6Y534d5pXRrR4NwtEUj3GetFUWyZzSUtmNXJXV9RmaYl5cOZHeJNUOpBHbOhzLoZkRhZ6V7h5dj9ESIRnaNN6Rq3kUrsGcuZFZNhkanNDTvYnPhqW"

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

Console