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

              
                <h2>ラジオボタンを使用する例</h2>
<div class="form-item">
  <p>映画を見てどう思いましたか</p>
  <div class="item">
      <input type="radio" name="movie" id="gooood"><label for="gooood">1. とても面白かった</label>
  </div>
  <div class="item">
      <input type="radio" name="movie" id="good"><label for="good">2. 普通に面白かった</label>
  </div>
  <div class="item">
      <input type="radio" name="movie" id="soso"><label for="soso">3. まあまあ</label>
  </div>
  <div class="item">
      <input type="radio" name="movie" id="notgood"><label for="notgood">4. 見て損した</label>
  </div>
</div>

<div class="form-item">
  <p>弊社のどのサービスをご希望ですか?</p>
  <div class="item">
      <input type="radio" name="service" id="goma"><label for="goma">ゴマすりサービス「sesame」</label>
  </div>
  <div class="item">
      <input type="radio" name="service" id="kanji"><label for="kanji">幹事代行サービス「イイカンジ」</label>
  </div>
  <div class="item">
      <input type="radio" name="service" id="keiba"><label for="keiba">競馬予想サービス「けいばん!」</label>
  </div>
</div>

<h2>あまり良くない例</h2>
<div class="form-item" id="pref">
  <p>出身地はどちらですか?</p>
</div>
              
            
!

CSS

              
                .form-item {
  margin-bottom: 20px;
}

label:hover {
  cursor: pointer;
}
              
            
!

JS

              
                const prefList = [
  "北海道","青森県","岩手県","宮城県","秋田県","山形県","福島県",
  "茨城県","栃木県","群馬県","埼玉県","千葉県","東京都","神奈川県",
  "新潟県","富山県","石川県","福井県","山梨県","長野県","岐阜県",
  "静岡県","愛知県","三重県","滋賀県","京都府","大阪府","兵庫県",
  "奈良県","和歌山県","鳥取県","島根県","岡山県","広島県","山口県",
  "徳島県","香川県","愛媛県","高知県","福岡県","佐賀県","長崎県",
  "熊本県","大分県","宮崎県","鹿児島県","沖縄県"
];

prefList.forEach((item) => {
  console.log(item);
  var new_element = '<div class="item"><input type="radio" name="pref" id="'+item+'1'+'"><label for="'+item+'1'+'">'+item+'</label></div>';
  document.getElementById('pref').innerHTML += new_element;
});

              
            
!
999px

Console