<input id="postalcode" type="text"/>
<div>
  ↑に郵便番号を入力
</div>
#postalcode { width: 10rem }
body { margin: 10px }
var element = document.getElementById('postalcode');
var maskOptions = {
  mask: '000-0000'
};
var mask = IMask(element, maskOptions);

External CSS

  1. https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css

External JavaScript

  1. https://unpkg.com/imask