kadyr

Untitled

Jun 21st, 2021
532
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3.  <head>
  4.   <meta charset="utf-8">
  5.   <title>output</title>
  6.  </head>
  7.  <body>
  8.     </script>
  9.     <input type="text" id="input1">
  10.     <span id= 'out'></span>
  11.     <button  onclick="work1()">Кнопка</button>
  12.     <p id = "span2"></p>
  13.     <script type="text/javascript">
  14.         function work1() {
  15.             var s1 = document.getElementById('input1').value;
  16.             var s2 = s1.split(' ');
  17.             var s3 = document.getElementById('out');
  18.             s3.innerHTML = s2.length;
  19.             if(s2.length<10){
  20.                s3.style.backgroundColor = "yellow";
  21.            }
  22.            else{
  23.                s3.style.backgroundColor = "white";
  24.            }
  25.        }
  26.    </script>
  27.  </body>
  28. </html>
RAW Paste Data