<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Simple contact search example</title>
    <style>

    </style>
  </head>
  <body>

  <label for="search">Search by contact name: </label>
  <input id="search" type="text">
  <button>Search</button>

  <p></p>


    <script>
    const contacts = ['Chris:2232322', 'Sarah:3453456', 'Bill:7654322', 'Mary:9998769', 'Dianne:9384975'];
    const para = document.querySelector('p');
    const input = document.querySelector('input');
    const btn = document.querySelector('button');

    btn.addEventListener('click', () => {
      const searchName = input.value.toLowerCase();
      input.value = '';
      input.focus();
      for(let i = 0; i < contacts.length; i++) {
        let splitContact = contacts[i].split(':');
        if(splitContact[0].toLowerCase() === searchName) {
          para.textContent = splitContact[0] + '\'s number is ' + splitContact[1] + '.';
          break;
        } else if(i === contacts.length - 1) {
          para.textContent = 'Contact not found.';
        }
      }
    });

    </script>

  </body>
</html>

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Simple contact search example</title>
    <style>

    </style>
  </head>
  <body>

  <label for="search">Search by contact name: </label>
  <input id="search" type="text">
  <button>Search</button>

  <p></p>


    <script>
    const contacts = ['Chris:2232322', 'Sarah:3453456', 'Bill:7654322', 'Mary:9998769', 'Dianne:9384975'];
    const para = document.querySelector('p');
    const input = document.querySelector('input');
    const btn = document.querySelector('button');

    btn.addEventListener('click', () => {
      const searchName = input.value.toLowerCase();
      input.value = '';
      input.focus();
      para.textContent = '';
      for (let contact of contacts) {
        let splitContact = contact.split(':');
        if (splitContact[0].toLowerCase() === searchName) {
          para.textContent = splitContact[0] + '\'s number is ' + splitContact[1] + '.';
          break;
        }
      }
      if (para.textContent === '') {
       para.textContent = 'Contact not found.';
     }
    });

    </script>

  </body>
</html>

Update example to match MDN page on looping
Update example to match MDN page on looping
