Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <html lang="ja" ng-app="App">
 <meta charset="UTF-8">
 <title>お問合せフォーム - 入力</title>
 <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.min.js"></script>
 <form method="post" name="sample" ng-controller="myController" novalidate>
     <th>名前<span class="strong">必須</span></th>
     <input type="text" name="name" ng-model="name" required="true" ng-maxlength="10" ng-class="{'error-bg':sample.name.$invalid}">
     <span ng-show="sample.name.$error.required" ng-if="sample.name.$touched">必須項目です</span>
     <span ng-show="sample.name.$error.maxlength">10文字以内で入力してください</span>
    <th>都道府県<span class="strong">必須</span></th>
    <td><select name="map" ng-model="map" ng-options="map for map in maps" required="true" ng-class="{'error-bg':sample.map.$error.required}">
      <option value="">選択してください</option>
      <span ng-show="sample.map.$error.required" ng-if="sample.map.$touched">必須項目です</span>
    <th>住所<span class="strong">必須</span></th>
      <input type="text" name="add" ng-model="add" required="true" ng-class="{'error-bg':sample.add.$invalid}">
      <span ng-show="sample.add.$error.required" ng-if="sample.add.$touched">必須項目です</span></td>
    <th>電話番号<span class="strong">必須</span></th>
     <input type="text" name="tel" ng-model="tel" required="true" ng-maxlength="12" ng-pattern="/^\d+$/" ng-class="{'error-bg':sample.tel.$invalid}">
     <span ng-show="sample.tel.$error.required" ng-if="sample.tel.$touched">必須項目です</span>
      <span ng-show="sample.tel.$error.pattern">入力が正しくありません</span>
     <span ng-show="sample.tel.$error.maxlength" ng-if=" !sample.tel.$error.pattern">12文字以内で入力してください</span>
    <th>メールアドレス<span class="strong">必須</span></th>
     <input type="text" name="mail" ng-model="mail" required="true" integer ng-class="{'error-bg':sample.mail.$invalid}">
     <span ng-show="sample.mail.$error.required" ng-if="sample.mail.$touched">必須項目です</span>
    <th>お問合せ内容<span class="strong">必須</span></th>
      <textarea name="data" ng-model="data" required="true" cols="30" rows="10" ng-class="{'error-bg':sample.data.$invalid}"></textarea>
      <span ng-show="sample.data.$error.required" ng-if="sample.data.$touched">必須項目です</span></td>
 <p class="submit">
   <input class="off" type="submit" name="submit" value="入力内容を確認してください" ng-if="sample.$invalid">
   <input class="on" type="submit" name="submit" value="送信する" ng-if="sample.$valid">

  var app = angular.module('App', []);
  app.controller("myController", function($scope) {
  $scope.maps = [
  '北海道', '青森県', '岩手県', '宮城県', '秋田県', 
    '山形県', '福島県', '茨城県', '栃木県', '群馬県', 
    '埼玉県', '千葉県', '東京都', '神奈川県', '新潟県', 
    '富山県', '石川県', '福井県', '山梨県', '長野県', 
    '岐阜県', '静岡県', '愛知県', '三重県', '滋賀県', 
    '京都府', '大阪府', '兵庫県', '奈良県', '和歌山県', 
    '鳥取県', '島根県', '岡山県', '広島県', '山口県', 
    '徳島県', '香川県', '愛媛県', '高知県', '福岡県', 
    '佐賀県', '長崎県', '熊本県', '大分県', '宮崎県', 
    '鹿児島県', '沖縄県'
  margin:20px auto;
  text-align: center;
  width: 700px;
  position: relative;
  width: 180px;
  border:1px solid #ccc;
  text-align: left;
  border:1px solid #ccc;
  text-align: left;
td span{
  color: #f03;
  text-align: center;
  position: absolute;
  right: 10px;
  background: #f03;color:#fff;
  padding:3px 8px;
  width: 230px;
  background: #fcc;
.submit input{
  border: none;
  padding: 7px 0;
  color: #fff;
  border-radius: 5px;
.submit .off{
  background: #999;
.submit .on{
  background: #3c3;
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.