Advertisement
fcamuso

Corso recupero Javascript - video 6

Nov 8th, 2022
1,236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.67 KB | None | 0 0
  1. <html>
  2.     <head>
  3.       <style>
  4.         #div_orario{background-color: rgb(233, 127, 127);
  5.                   padding: 0 35%; font-size: 30px; text-align: center;}
  6.         button {background-color: red; border-radius: 15px; color: white;
  7.                font-size: 30px;}
  8.         .orario{background: yellow;}
  9.         #bottoni {text-align: center;}
  10.       </style>
  11.     </head>
  12.     <body>
  13.       <div id="div_orario">
  14.         <p> Orario
  15.             <span id="ore" class="orario"> </span>  
  16.             <span>:</span>
  17.             <span id="minuti" class="orario"> </span>
  18.             <span>:</span>
  19.             <span id="secondi" class="orario"> </span>        
  20.         </p>
  21.       </div>
  22.  
  23.       <div id="bottoni">
  24.         <button id="btn_start0"> START clock</button>
  25.         <button id="btn_stop1"> STOP clock </button>
  26.       </div>
  27.       <img src="teatro.png" alt=""><br><br>
  28.  
  29.       <form action="">
  30.         cognome <input type="text">
  31.         mf <input type="radio" " id="rbm" value="M">
  32.           <input type="radio"  id="rbf" value="F">
  33.        <input type="submit" value="OK">
  34.        
  35.      </form>
  36.  
  37.      <script>
  38.        
  39.        document.querySelector("input[type='submit']")
  40.          .addEventListener("click", function () {
  41.            alert(document.querySelector("input[type='text']").value);
  42.            
  43.            const rb = document.getElementById("rbm");
  44.            if (rb.checked) alert(rb.value);
  45.          })
  46.  
  47.        if (document.querySelector("img").alt === "" )
  48.           document.querySelector("img").title = "Testo ...";
  49.  
  50.        const coloriButton = ["purple", "purple"];
  51.  
  52.        // document.querySelector("#bottoni")
  53.         //   .style.border = "solid 2px blue";
  54.  
  55.         //   document.querySelector("p")
  56.         //   .style.border = "dashed 5px yellow";
  57.  
  58.         //   document.querySelector(".orario")
  59.         //   .style.border = "solid 3px green";
  60.  
  61.           document.querySelector("img[src='teatro.png']")
  62.           .style.width="100px";
  63.  
  64.           document.querySelector("img[src='teatro.png']")
  65.             .style.height="100px";
  66.  
  67.           let bottoni = document.getElementsByTagName("button");
  68.           for (let bottone of bottoni)
  69.             bottone.style.backgroundColor = "blue";
  70.  
  71.           const spans = document.getElementsByClassName("orario");
  72.           for (let span of spans)
  73.             span.style.border = "solid 3px green";
  74.  
  75.           bottoni = document.querySelectorAll("button");
  76.           for (let bottone of bottoni)
  77.             bottone.style.backgroundColor = "purple";
  78.  
  79.           document.getElementById("minuti").classList.remove("orario")          
  80.  
  81.       </script>
  82.     </body>
  83.     </html>
  84.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement