|  | 
	                
  
    | 
	 
        ผมอยากให้ตัวเลข ที่มันสุ่มใน js  อยู่ใน  <a ></a>  แต่ในตัวอย่างอยู่ใน <input  /> ต้องแก้ยังไงมั้งหรอครับ     |  
    |  |  
 
              
  
    | 
 
        
          |  |  |  |  |  
          |  |  | 
            
              | แบบนี้เปล่าครับ 
 
  Quote: <input type="text" id="digit1" class="rand" value=0 /><input type="text" id="digit2" class="rand" value=0 />
 <input type="text" id="digit3" class="rand" value=0 /><br />
 <a id="a1"></a>
 <a id="a2"></a>
 <a id="a3"></a>
 <input type="button" id="rolldice" value="หมุน-หยุดตัวเลข" /
 Code (JavaScript)
 
 
$(document).ready(function(){
    var ID,d1,d2,d3;
    var box1 = $("#digit1"),
        box2 = $("#digit2"),
        box3 = $("#digit3"),
        a1 = $("#a1"),
        a2 = $("#a2"),
        a3 = $("#a3");    
    $("input#rolldice").toggle(function(){ 
       ID = setInterval(function(){
            d1 = Math.floor(Math.random()*10);
            d2 = Math.floor(Math.random()*10);
            d3 = Math.floor(Math.random()*10);
            box1.val(d1);
            box2.val(d2);
            box3.val(d3);
            a1.text(d1);
            a2.text(d2); 
            a3.text(d3);
        },100);
    },function(){
        clearInterval(ID);
    });
});
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2013-08-15 17:35:12 | By :
                            Manussawin |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ขอบคุณมากครับผม  
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2013-08-15 17:45:20 | By :
                            aibot |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | พอทราบไหมครับว่าทำยังไงให้ 
 ตอนหยุด มันหยุด ทีละอัน อันที่ 1 หยุด ตามด้วย 2 เเล้วก็ 3 ห่างกัน 1 วิ
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2013-08-15 19:17:30 | By :
                            aibot |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | โค้ดชุดนี้คุ้นๆน่ะค่ะ 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2013-08-15 20:24:22 | By :
                            survivor |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ของคุณไงครับผม  
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2013-08-15 22:41:58 | By :
                            aibot |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  |  |