Home > Web Front-end > JS Tutorial > This can also be regarded as an order generation method

This can also be regarded as an order generation method

巴扎黑
Release: 2016-11-25 09:51:19
Original
1278 people have browsed it

<!doctype html>
<html> 
<head> 
 <meta charset="UTF-8"> 
  <meta name="Generator" content="EditPlus®"> 
   <meta name="Author" content="">  
   <meta name="Keywords" content=""> 
    <meta name="Description" content=""> 
     <title>Document</title>
       <script type="text/javascript"> 
          getDataId=function(){return new Date().getTime()+getRandomNum(1,10,3)        //return new Date().getTime()//return getRandomNum(1,10,3);};     getRandomNum=function(a,e,k){ 
           var h="";   
               for(var c=0;c<k;c++)  {  
                 var f=e-a;var b=Math.random(); h+=(a+Math.round(b*f)) 
                  } 
                  return h
                  };
                  function aa(){
                  document.getElementById(&#39;aaa&#39;).value=getDataId();
                  }
                  </script>
                   </head>
                    <body>
                      <input type=&#39;button&#39; value="点击" onclick="aa();">
                        <input type=&#39;text&#39; value=&#39;&#39; id="aaa"/>
                         </body>
                         </html>
Copy after login


Related labels:
js
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template