Advertisement
lemansky

Untitled

Dec 2nd, 2021 (edited)
831
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 4.72 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <title>Document</title>
  6.     <link rel="stylesheet" href="https://bootswatch.com/4/flatly/bootstrap.min.css">
  7.     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  8.  
  9.     <!-- Задача 1: създайте скрипт, чрез който при натискане върху бутон се взима неговата стойност и клас от типа btn- (btn-info, btn-warning, btn-default и т.н.) и се поставя върху голям бутон със стойност 0. Необходимо е след повторно натискане, на който и да е друг бутон, класът който е бил добавен преди това да се премахне. (в противен случай големия бутон ще получи всички класове един след друг и накрая няма да реагира при смяна на цвета) -->
  10.  
  11.      <!-- задача 2:  създайте скрипт, чрез който при натискане на бутон плюс се увеличава бутона с надпис Result с по 5px падинг. Първоначалния размер на бутона е 5px . При натискане на бутона плюс трябва да стане с размер 10px,  при повторно натискане на плюс - 15px ...  Нека бутон - да намалява падинга с по 5 -->
  12.  
  13.     <!-- задача 3: да се създаде скрипт, чрез който при натискане на бутон с надпис Change се взима съдържанието на текстово поле, което може да е число от 1 до 3 и в съотвествие с въведеното число се добавя клас .progress-bar-animated на 1 от 3-те прогресиращи ленти.  -->
  14.  
  15.    <script>
  16.      document.addEventListener('DOMContentLoaded', () => {
  17.  
  18.     });
  19.    </script>
  20. </head>
  21. <body>
  22.     <!-- задача 1 -->
  23. <div class="container my-4">
  24.     <table style="display:inline-block;vertical-align:top;">
  25.       <tr>
  26.         <td> <input type="button" class="cube form-control btn btn-info" style="width:50px;height:50px" value="1"> </td>
  27.         <td> <input type="button" class="cube form-control btn btn-warning" style="width:50px;height:50px" value="2"> </td>
  28.         <td> <input type="button" class="cube form-control btn btn-info" style="width:50px;height:50px" value="3"> </td>
  29.       </tr>
  30.       <tr>
  31.         <td> <input type="button" class="cube form-control btn btn-danger" style="width:50px;height:50px" value="4"> </td>
  32.         <td> <input type="button" class="cube form-control btn btn-success" style="width:50px;height:50px" value="5"> </td>
  33.         <td> <input type="button" class="cube form-control btn btn-warning" style="width:50px;height:50px" value="6"> </td>
  34.       </tr>
  35.       <tr>
  36.         <td> <input type="button" class="cube form-control btn btn-default" style="width:50px;height:50px" value="7"> </td>
  37.         <td> <input type="button" class="cube form-control btn btn-info" style="width:50px;height:50px" value="8"> </td>
  38.         <td> <input type="button" class="cube form-control btn btn-primary" style="width:50px;height:50px;" value="9"> </td>
  39.       </tr>
  40.     </table>
  41.     <span style="display:inline-block;vertical-align:top;">
  42.       <input type="button" class="form-control" id="" style="width:150px;height:150px;display:inline-block;font-size:50px;" value="0">
  43.     </span>
  44.   </div>
  45.  
  46.   <!-- задача 2 -->
  47.   <div class="container my-4">
  48.     <input type="button" class="btn btn-danger" id="" value="+"/>
  49.     <input type="button" class="btn btn-danger" id="" value="-">
  50.     <a href="#" class="btn btn-info m-3" id="" data-size="1" style="padding:5px;"> Result </a>
  51.   </div>
  52.  
  53.     <!-- Задача 3 -->
  54.   <div class="container my-4">
  55.     <div class="progress progress-striped " style="height:20px;">
  56.         <div class="progress-bar progress-bar-striped bg-success " style="width: 100%;"></div>
  57.     </div>
  58.     <div class="progress progress-striped " style="height:20px;">
  59.         <div class="progress-bar progress-bar-striped bg-info " style="width: 60%;"></div>
  60.     </div>
  61.     <div class="progress progress-striped " style="height:20px;">
  62.         <div class="progress-bar progress-bar-striped bg-danger " style="width: 30%;"></div>
  63.     </div>
  64.     <div class="form-group">
  65.         <input type="text" placeholder="въведете число между 1 и 3" class="form-control" id=""/>
  66.         <input type="button" class="form-control btn btn-info" value="Change" id=""/>
  67.       </div>
  68.   </div>
  69. </body>
  70. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement