onkeyup="this.value=this.value.replace(/\D/g,‘‘)"
js生产UUID
1 var createUUID = (function (uuidRegEx, uuidReplacer) { 2 return function () { 3 return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(uuidRegEx, uuidReplacer).toUpperCase(); 4 }; 5 })(/[xy]/g, function (c) { 6 var r = Math.random() * 16 | 0, 7 v = c == "x" ? r : (r & 3 | 8); 8 return v.toString(16); 9 }); 10 alert(createUUID());
时间: 2024-11-08 16:37:52