Bank card and phone number placeholder

Source: Internet
Author: User

Bank card

Phone number

Html

<!DOCTYPE HTML><HTML>    <Head>        <MetaCharSet= "UTF-8">        <title></title>         <Metaname= "Viewport"content= "Width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, User-scalable=yes" />         <Scripttype= "Text/javascript"src= "Js/jquery-1.8.3.min.js"></Script>    </Head>    <Body>        <inputtype= "text"name= "Banknumber"ID= "Banknumber"/>    </Body></HTML><Scriptsrc= "Js/cutnumber.js"></Script><Script>    $("#bankNumber"). Cutnumber ({type:"Phone"}); </Script>

Js

/* Analog phone and bank card number interval effect plug-in if the bank card reference {type: "bank"} if it is the phone argument {type: "Phone"} */;(function ($) {$.fn.extend ({"Cutn            Umber ": function (Options) {if (!isvalid (options)) return this;            Use Jquery.extend override plugin default parameter var opts = $.extend ({}, Options);            If the bank is used, it will execute the 444 format if (Opts.type = = "Bank") {$ (this). Prop ({maxlength:23}); Return This.on ("KeyUp", function () {This.value =this.value.replace (/\s/g, "). Replace (/\d/g,"). Replace (/(\d{               4}) (? =\d)/g, "$");             })}else if (Opts.type = = "Phone") {$ (this). Prop ({maxlength:13}); Return This.on ("KeyUp", function () {This.value =this.value.replace (/\s/g, "). Replace (/\d/g,"). Replace (/(\d{               3}) (? =\d)/, ' $ '). Replace (/(\d{4}) (? =\d)/, ' $ ');         })}else{return This.on ("KeyUp", function () {this.value = This.value;     })         }        }     }); Private method, the detection parameter isNo legal function IsValid (options) {return!options | | (Options && typeof options = = = "Object")?    True:false; }}) (Window.jquery);

  

Bank card and phone number placeholder

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.