Affichage des images aléatoire avec js

<!DOCTYPE html>
<html>
<head>
  <title>RÉCUPÉRER LE NOM DU FICHIER DEPUIS INPUT FILE | par NGLESSON </title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="author" content="Mezgani said">
  <meta name="copyright" content="NGLESSON">
  <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet">
  <link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
  <div class="container">
    <div class="row mx-auto text-centermt-5">
      <div class="col-lg-4 col-12">
        <img src="https://www.nglesson.com/assets/imgs/menu/integration-web.jpg" class="img-fluid" id="attach" alt="attach" title="attach">
      </div>
    </div>
  </div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="script.js"></script>
</body>
</html>
.custom-attach-upload {
    border: 1px solid #999;
    display: inline-block;
    padding: 12px 12px;
    cursor: pointer;
    background: #ccc;
}
.custom-attach-upload:hover {
    background: #FFF;
}
//window.onload = randomImg;

window.onload = function() {
    randomImg();
};

var myFile = new Array("https://www.nglesson.com/assets/imgs/menu/solution-technique.jpg",
"https://www.nglesson.com/assets/imgs/menu/problematique.jpg",
"https://www.nglesson.com/assets/imgs/menu/cours-web.jpg");

function randomImg() {
     var randomNum = Math.floor(Math.random() * myFile.length);
     document.getElementById("attach").src = myFile[randomNum];
}
Up Down Animation With CSS Style01

Up Down Animation With CSS Style01

Timeline style03

Timeline style03

Table bootstrap with Datatable

Table bootstrap with Datatable

Planète animée style01

Planète animée style01

Menu aside style01 slide out

Menu aside style01 slide out

Input valid invalid HTML CSS

Input valid invalid HTML CSS

Header with background animate 01

Header with background animate 01

Form Step With B4 Style01

Form Step With B4 Style01

Cards box with title

Cards box with title

Card Bootstrap4 02

Card Bootstrap4 02

Background div gradient

Background div gradient

Affichage des images aléatoire avec js

Affichage des images aléatoire avec js