Здравствуйте! не могу получить console.log(elem);,в консоль ваще ничего не выдает

document.addEventListener('DOMContentLoaded', () => {
  'use strict'

  const form = document.querySelector('form');
  console.log(form);

  form.addEventListener('submit', (even) => {
    even.preventDefault();

    for (let elem of form.elements) {
      console.log(elem);
    }
  })
})
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #1B2473;
  color: #787878;
  font-family: Roboto;
  font-size: 16px;
}

.wrapper {
  min-width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  padding: 20px;
}

.form {
  max-width: 600px;
  width: 100%;
  padding: 26px 46px 26px 45px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0px 0px 40px 10px rgba(0, 0, 0, 0.25);
}

.form__title {
  text-align: center;
  font-size: 50px;
  font-weight: bold;
  line-height: 100%;
  margin-bottom: 17px;
}

.form__group {}

.form__input_mg-bottom-13 {
  margin-bottom: 13px;
}

.form__input_mg-bottom-16 {
  margin-bottom: 16px;
}

.form__label-input {
  font-weight: bold;
  line-height: 100%;
}

.form__input {
  max-width: 509px;
  width: 100%;
  height: 49px;
  border: 2px solid #787878;
  color: #787878;
  border-radius: 10px;
  margin-top: 3px;
  padding: 0 0 0 10px;
  font-size: 28px;
}

.form__input::placeholder {
  font-weight: bold;
  line-height: 129%;
  color: #cccccc;
}

.form__label-checkbox {
  position: relative;
  font-size: 14px;
  line-height: 114%;
  margin-bottom: 52px;
  display: inline-flex;
  align-items: center;
  align-content: center;
  margin-left: 35px;
}

.form__checkbox {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.form__check {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 2px solid #787878;
  border-radius: 7px;
  margin-left: -35px;
}

.form__checkbox:checked+.form__check::after {
  content: '✓';
  position: absolute;
  left: 5px;
  top: 3px;
  color: #787878;
}

.form__btn {
  width: 180px;
  text-align: center;
  color: #fff;
  font-size: 24px;
  font-weight: bold;
  line-height: 67%;
  background: #1A226B;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  padding: 18px;
}

.form__btn:hover {
  background: #3e4588;
}

.form__button-block {
  display: flex;
  justify-content: center;
  align-items: center;
}


/* ------------- 320 - 768------------------------- */

@media (max-width: 768px) {
  .form {
    max-width: 728px;
    height: 100%;
  }
  .form__title {
    font-size: 60px;
    line-height: 83%;
    margin-bottom: 13px;
  }
  .form__label-input {
    font-size: 24px;
    line-height: 67%;
  }
  .form__input {
    max-width: 638px;
    margin-top: 8px;
  }
  .form__input::placeholder {
    color: #cccccc;
  }
  .form__label-checkbox {
    font-size: 18px;
    line-height: 89%;
    margin-bottom: 64px;
  }
  .form__checkbox {
    width: 32px;
    height: 32px;
  }
  .form__button-block {}
  .form__btn {
    max-width: 220px;
    min-height: 80px;
    padding: 32px 64px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
}
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="https://fonts.googleapis.com/css?family=Roboto:regular,700&display=swap" rel="stylesheet" />
  <link rel="stylesheet" href="style.css">
  <title>Form</title>
</head>

<body>
  <div class="wrapper">
    <form action="#" class="form">

      <h1 class="form__title">Регистрация</h1>

      <div class="form__group">
        <label for="" class="form__label-input">Email</label>
        <input class="form__input form__input_mg-bottom-13" name="email" type="email" placeholder="Введите Email" required>
      </div>

      <div class="form__group">
        <label for="" class="form__label-input">Пароль</label>
        <input class="form__input form__input_mg-bottom-16" name="pass" type="password" placeholder="Введите пароль" required>
      </div>

      <div class="form__group">
        <label class="form__label-checkbox">
                    <input class="form__checkbox" name="checkbox" type="checkbox"> 
                    <div class="form__check"> </div> 
                    Я согласен получать обновления на почту
                </label>
      </div>
      <div class="form__button-block">
        <button class="form__btn" type="submit">Регистрация</button>
      </div>
    </form>
  </div>
  <script src="./script.js"></script>
</body>

</html>


Ответы (0 шт):