Pen Settings



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


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


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.


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.


  <script type="text/javascript">
  // 配列(問題と答えの選択肢)
  var array1 = [['販売手数料', 0], ['広告宣伝費', 0],
                ['受取利息', 1],
                ['支払利息', 2],
                ['固定資産売却益', 3],
                ['固定資産売却損', 4]];
  function answer(){
    for (const element of array1) {
      var choices = document.getElementsByName(element[0]) ;
      if(choices[element[1]].checked) document.getElementById('color'+ element[0]).style.color="blue"
      else document.getElementById('color'+ element[0]).style.color="red"

  <form name="f">
    <input type="button" value="答え合わせ" onclick="answer()">
    <div id="order_list">
  <script type="text/javascript">
  var d1 = document.getElementById('order_list');
  // 配列をシャッフル
  function arrayShuffle (array) {
    var k, t, len;
    len = array.length;
    if (len < 2) {
      return array;
    while (len) {
      k = Math.floor(Math.random() * len--);
      t = array[k];
      array[k] = array[len];
      array[len] = t;
    return array;
  for (const element of array1) { // 問題の作成
    d1.insertAdjacentHTML('afterend', '<div class="order">\
      <b><p id="color'+ element[0] +'">\
      '+ element[0] +'</b><br>\
      <input type="radio" name="'+ element[0] +'" > 販売費及び一般管理費\
      <input type="radio" name="'+ element[0] +'" > 営業外収益\
      <input type="radio" name="'+ element[0] +'" > 営業外費用\
      <input type="radio" name="'+ element[0] +'" > 特別利益\
      <input type="radio" name="'+ element[0] +'" > 特別損失\
    <input type="button" value="答え合わせ" onclick="answer()">