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

              
                <div>
  <h1>당신의 파스타, 재료를 골라주십시오</h1>
  <h2>면을 골라주세요</h2>
  <input type="radio" name="noodle" value="pasta" id="pasta" checked>
  <label for="pasta">파스타(알 덴테)</label>
  <input type="radio" name="noodle" value="tofunoodle" id="tofunoodle">
  <label for="tofunoodle">두부면(좁은면)</label>
  <input type="radio" name="noodle" value="tofunoodlew" id="tofunoodlew">
  <label for="tofunooeldw">두부면(넓은면)</label>
  <h2>소스를 골라주세요</h2>
  <input type="radio" name="sauce" value="tomato" id="tomato" checked>
  <label for="tomato">토마토</label>
  <input type="radio" name="sauce" value="cream" id="cream">
  <label for="cream">크림</label>
  <input type="radio" name="sauce" value="rose" id="rose">
  <label for="rose">로제</label>
  <input type="radio" name="sauce" value="basil" id="basil">
  <label for="basil">바질크림</label>
  <h2>건더기를 골라주세요</h2>
  <input type="checkbox" name="topping" value="닭찌찌살" id="chickenbreast" checked>
  <label for="chickenbreast">닭찌찌살</label>
  <input type="checkbox" name="topping" value="양파" id="onion" checked>
  <label for="onion">양파</label>
  <input type="checkbox" name="topping" value="목이버섯" id="woodear">
  <label for="woodear">목이버섯</label>
  <input type="checkbox" name="topping" value="양송이버섯" id="champignon">
  <label for="champignon">양송이버섯</label>
  <input type="checkbox" name="topping" value="새송이버섯" id="kingoyster">
  <label for="kingpyster">새송이버섯</label>
  <input type="checkbox" name="topping" value="베이컨" id="bacon">
  <label for="bacon">베이컨</label>
  <input type="checkbox" name="topping" value="관자" id="clam">
  <label for="clam">관자</label>
  <input type="checkbox" name="topping" value="차돌박이" id="beef">
  <label for="beef">차돌박이</label>
  <h2>다 골랐으면 눌러눌러! </h2>
  <button id="readytocook">다 골랐다!</button>
</div>
<div id="pastaready"></div>
              
            
!

CSS

              
                @font-face {
    font-family: 'Ownglyph_meetme-Rg';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2402_1@1.0/Ownglyph_meetme-Rg.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

body {
  font-family: 'Ownglyph_meetme-Rg';
  font-size: 14pt;
}

div {
  width: 1024px;
  margin: 0 auto;
}

label {
  font-size: 16pt;
}

input {
  margin: 5px 5px 15px 5px;
  vertical-align: middle;
}

input[type="radio"] {
  appearance: none;
  width: 1.5em;
  height: 1.5em;
  border: 1px solid #aaaaaa;
  border-radius: 50%;
  transition: 0.2s;
}

input[type="radio"]:checked {
  border: none;
}

input[type="radio"]:checked::after {
  content:'❤️';
}

input[type="checkbox"] {
  appearance: none;
  width: 1.5em;
  height: 1.5em;
  border: 1px solid #aaaaaa;
  border-radius: 50%;
  transition: 0.2s;
}

input[type="checkbox"]:checked {
  border: none;
}

input[type="checkbox"]:checked::after {
  content:'❤️';
}

button {
  width: 180px;
  height: 60px;
  border: none;
  background-color: #f7cac9;
  font-family: 'Ownglyph_meetme-Rg';
  font-size: 20pt;
}
              
            
!

JS

              
                const pastaNoodle = document.getElementsByName("noodle");
const pastaSauce = document.getElementsByName('sauce');
const pastaTopping = document.getElementsByName('topping');
const readytocook = document.querySelector("#readytocook");
const pastaReady = document.querySelector("#pastaready");
const pastapick = document.createElement("p");
let noodle = "";
let sauce = "";
let topping = [];

readytocook.addEventListener('click',(e)=>{
  pastaNoodle.forEach((item) => {
    if (item.checked && item.value == "pasta") {
      noodle = "파스타";
    }
    else if (item.checked && item.value == "tofunoodle") {
      noodle = "두부면";
    }
    else if (item.checked && item.value == "tofunoodlew") {
      noodle = "넓은 두부면";
    }
  });
  pastaSauce.forEach((item) => {
    if (item.checked && item.value == "tomato") {
      sauce = "토마토";
    }
    else if (item.checked && item.value == "cream") {
      sauce = "크림";
    }
    else if (item.checked && item.value == "rose") {
      sauce = "로제";
    }
    else if (item.checked && item.value == "basil") {
      바질크림
    }
  });
  pastaTopping.forEach((item) => {
    if (item.checked) {
      topping.push(item.value)
    }
  });
  pastapick.innerText = `${noodle}에 ${sauce}소스 그리고 토핑은 ${topping} 입니다.`;
  pastaReady.appendChild(pastapick);
});
              
            
!
999px

Console