function gaga(obj){ // The value allows entering a decimal point and digits obj.value = obj.value.replace(/[^d.]/g,""); //Replace all non-digits first, except numbers and. obj.value = obj. value.replace(/^./g,""); //The first one must be a number instead of a number. obj.value = obj.value.replace(/.{2,}/g,". "); // Ensure that only one appears, not multiple. obj.value = obj.value.replace(".","$#$").replace(/./g,""). replace("$#$","."); //Guarantee. appears only once and cannot appear more than twice
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn