/ Question & Réponse / Create mask for input with javascript Create mask for input with javascript Jquery, Javascript Développement front-end //In HTML //JS $("input[name='masknumber']").on("keyup", function(){ $("input[name='number']").val(destroyMask(this.value)); this.value = createMask($("input[name='number']").val()); }) function createMask(string){ console.log(string) return string.replace(/(\d{2})(\d{3})(\d{2})/,"$1-$2-$3"); } function destroyMask(string){ console.log(string) return string.replace(/\D/g,'').substring(0, 8); } Question & Réponse How to create a directory using NodeJS ? Node.js Développement back-end How to display all files in a directory using Node.js ? Node.js Développement back-end How to scroll top position in page HTML with Jquery Jquery Développement front-end How to force page scroll position to top at page refresh in HTML Javascript, Jquery Développement front-end How to get random value out of an array ? PHP Développement back-end How to reload or refresh an iframe ? Javascript Développement front-end How to reload or refresh an iframe ? Javascript Développement front-end How to style the input type time CSS Intégration web How to Copy Text with javascript Javascript Développement front-end How Minify CSS with PHP PHP Développement back-end Convert special characters to HTML in Javascript Javascript Développement front-end How to create a offset in Bootstrap 4 Bootstrap 4 Intégration web