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];
}
page scroll progress bar

page scroll progress bar

login page green one

login page green one

input file récupérer le nom du fichier

input file récupérer le nom du fichier

Social Media Icons

Social Media Icons

Planète animée style01

Planète animée style01

Input range slider HTML style01

Input range slider HTML style01

Form login 03

Form login 03

Form Création de compte

Form Création de compte

Checkbox et boutons radios personnalisés en CSS

Checkbox et boutons radios personnalisés en CSS

Carousel 8 bloc with B4

Carousel 8 bloc with B4

Buttons Styles Inspirations

Buttons Styles Inspirations

Add Remove dynamic rows with dynamic ID of input in HTML table

Add Remove dynamic rows with dynamic ID of input in HTML table