2017-05-17 8 views

답변

0

:

var array = ["https://madeby.google.com/static/images/google_g_logo.svg","http://searchengineland.com/figz/wp-content/seloads/2015/12/google-amp-fast-speed-travel-ss-1920.jpg"] 
 
//whatever links you want 
 
function go(){ 
 
    var x = array[Math.floor(Math.random()*array.length)] 
 
    document.getElementById("hi").src=x 
 
}
 <button onclick="go()">start</button> 
 
     <img id="hi"></img>