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];
}
Asidebar Bootstrap4 style01

Asidebar Bootstrap4 style01

Background overlay

Background overlay

Bootstrap 3 Popover avec html contenu

Bootstrap 3 Popover avec html contenu

Bootstrap3 Sidebar CSS

Bootstrap3 Sidebar CSS

Calculer la some des colones avec jquery

Calculer la some des colones avec jquery

Create icon animate with svg

Create icon animate with svg

Form login with background image changed style01

Form login with background image changed style01

Image hover 06

Image hover 06

Image hover effects style

Image hover effects style

Planète animée style01

Planète animée style01

SwiperJS style01

SwiperJS style01

input radio checkbox b4 style

input radio checkbox b4 style