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.


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.


                <div class="container">
  <h1>validate.js 台灣手機號碼認證範例</h1>
  <form id="myform">

    <div class="form-group">
      <label for="exampleInputEmail1">手機號碼</label>
      <input type="text" class="form-control" id="phone" placeholder="phone" name="phone">
      <input type="radio" id="ios" name="os" value="ios" checked />
      <label for="ios" class="text">
      <input type="radio" id="android" name="os" value="android" />
      <label for="android" class="text">
    <button type="submit" class="btn btn-primary">送出</button>


                @media(min-width: 960px) { 
  .container {
    width: 450px;
    margin: 0 auto;
.container h1 {
  margin: 20px;
  text-align: center;
.container form {
  padding: 20px;
  background: #EBF0F4;
  border-radius: 10px;


                jQuery.validator.methods.matches = function (value, element, params) {
    var re = new RegExp(params);
    return this.optional(element) || re.test(value);
var re = new RegExp("^09\\d{8}$");
$( "#myform" ).validate({
  rules: {
    phone: {
      required: true,
      matches: re, // <-- no such method called "matches"!
    os: {
      required: true,
  messages: {
    phone: {
      required: "請填寫您的手機號碼",
      matches: "您的手機號碼格式錯誤,需為10位的正確數字手機格式",
     os: {
      required: "請填寫您的手機系統",
  submitHandler: function (form) {