Advertisement
Guest User

js sofiane

a guest
Nov 15th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // LUNDI
  2. var allOptionsL = document.querySelectorAll('#sLundi > option') //
  3.  
  4.         for (var i = 0; i < allOptionsL.length; i++) {
  5.             allOptionsL[i].addEventListener('mouseover', highlightL);
  6.         }
  7.  
  8.         function highlightL() {
  9.  
  10.             for (var i = 0; i < allOptionsL.length; i++) {
  11.                 allOptionsL[i].style.backgroundColor = ""; //
  12.             }
  13.             this.style.backgroundColor = "lightgray";
  14.         }
  15.  
  16. // MARDI      
  17. var allOptionsM = document.querySelectorAll('#sMardi > option') //
  18.  
  19.         for (var i = 0; i < allOptionsM.length; i++) {
  20.             allOptionsM[i].addEventListener('mouseover', highlightM);
  21.         }
  22.  
  23.         function highlightM() {
  24.  
  25.             for (var i = 0; i < allOptionsM.length; i++) {
  26.                 allOptionsM[i].style.backgroundColor = ""; //
  27.             }
  28.             this.style.backgroundColor = "lightgray";
  29.         }
  30.  
  31. // MERCREDI
  32. var allOptionsMer = document.querySelectorAll('#sMercredi > option') //
  33.  
  34.         for (var i = 0; i < allOptionsMer.length; i++) {
  35.             allOptionsMer[i].addEventListener('mouseover', highlightMer);
  36.         }
  37.  
  38.         function highlightMer() {
  39.  
  40.             for (var i = 0; i < allOptionsMer.length; i++) {
  41.                 allOptionsMer[i].style.backgroundColor = ""; //
  42.             }
  43.             this.style.backgroundColor = "lightgray";
  44.         }
  45.  
  46. // JEUDI
  47. var allOptionsJ = document.querySelectorAll('#sJeudi > option') //
  48.  
  49.         for (var i = 0; i < allOptionsJ.length; i++) {
  50.             allOptionsJ[i].addEventListener('mouseover', highlightJ);
  51.         }
  52.  
  53.         function highlightJ() {
  54.  
  55.             for (var i = 0; i < allOptionsJ.length; i++) {
  56.                 allOptionsJ[i].style.backgroundColor = "";
  57.             }
  58.             this.style.backgroundColor = "lightgray";
  59.         }
  60.  
  61. //VENDREDI    
  62. var allOptionsV = document.querySelectorAll('#sVendredi > option')
  63.  
  64.         for (var i = 0; i < allOptionsV.length; i++) {
  65.             allOptionsV[i].addEventListener('mouseover', highlightV);
  66.         }
  67.  
  68.         function highlightV() {
  69.  
  70.             for (var i = 0; i < allOptionsV.length; i++) {
  71.                 allOptionsV[i].style.backgroundColor = "";
  72.             }
  73.             this.style.backgroundColor = "lightgray";
  74.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement