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 id="formWrapper">
            <form action="https://docs.google.com/forms/formResponse" method="post" name="myForm" target="dummyIframe">
              <div class="form-group">
                <h4>メールアドレス<span>※</span></h4>
                <input type="mail" id="mail" name="emailAddress" placeholder="mail@example.com">
              </div>
              <div class="form-group">
                <h4>お名前<span>※</span></h4>
                <input type="text" id="name" name="entry.1516241962" placeholder="四葉 太郎">
              </div>
              <div class="form-group">
                <h4>お問い合わせ項目</h4>
                <ul>
                  <li><input type="radio" name="entry.2025762564" value="ブログについて"><label>ブログについて</label></li>
                  <li><input type="radio" name="entry.2025762564" value="ホームページについて"><label>ホームページについて</label></li>
                  <li><input type="radio" name="entry.2025762564" value="その他"><label>その他</label></li>
                </ul>
              </div>
              <div class="form-group">
                <h4>お問い合わせ内容<span>※</span></h4>
                <textarea id="message" name="entry.321807746" placeholder="質問やご要望について" rows="5" cols="40"></textarea>
              </div>
              <input type="submit" value="送信" onclick="submitForm()">
            </form>
            <iframe name="dummyIframe" style="display:none;"></iframe>
          </div>
          <div id="thxMessage" style="display:none;"><p>お問い合わせありがとうございました。</p></div>
          <script>
            function submitForm(){
              var val=document.getElementsByName("emailAddress")[0];
              if (val.value.length == 0) {
                alert("メールアドレスは必須項目です");
                val.focus();
                return;
              }
              var flag = 0;
        	      if(!document.myForm.emailAddress.value.match(/.+@.+\..+/)){
                   flag = 1;
                 }
        	         if(flag){
        		           window.alert('メールアドレスが正しくありません');
        		             return
                         }
              var val=document.getElementsByName("entry.1516241962")[0];
              if (val.value.length == 0) {
                alert("お名前は必須項目です");
                val.focus();
                return;
              }
              var val=document.getElementsByName("entry.321807746")[0];
              if (val.value.length == 0) {
                alert("お問い合わせ内容は必須項目です");
                val.focus();
                return;
              }
              document.myForm.submit();
              document.getElementById('formWrapper').style.display = 'none';
              document.getElementById('thxMessage').style.display = 'block';
            }
          </script>
              
            
!

CSS

              
                li {
list-style: none;
}

span {
color: #f00;
}
              
            
!

JS

              
                
              
            
!
999px

Console