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];
}
Ajouter supprimer une tr dans une table avec l'insertion des options sur une balise select

Ajouter supprimer une tr dans une table avec l'insertion des options sur une balise select

Calculatrice style01

Calculatrice style01

Card 4 Product Style01

Card 4 Product Style01

Card Bootstrap4 02

Card Bootstrap4 02

Checkbox et boutons radios personnalisés en CSS

Checkbox et boutons radios personnalisés en CSS

Convertir une div en image

Convertir une div en image

Double Scrollbar with Plugin Jquery in table

Double Scrollbar with Plugin Jquery in table

Dropdown right aligned B4

Dropdown right aligned B4

Image hover 03

Image hover 03

Image hover style border top

Image hover style border top

Input range slider HTML style02

Input range slider HTML style02

Table Responsive with css 01

Table Responsive with css 01