jQuery inputmask “mm/yyyy”


jQuery inputmask “mm/yyyy”

HTML:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://githubraw.com/RobinHerbots/jquery.inputmask/3.x/dist/jquery.inputmask.bundle.js"></script>
<input class="mask" type="text">

JAVASCRIPT

(function($){ 
  $('.mask').inputmask("datetime",{
    mask: "1/y", 
    placeholder: "mm/yyyy", 
    leapday: "-02-29", 
    separator: "/", 
    alias: "dd/mm/yyyy"
  });  
})(jQuery)

Live example: https://jsfiddle.net/sans_amour/ekgz6jmh/

Leave a Reply