커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
3-5 수업 관련 질문
[왕초보] 코딩이 처음이어도 쉽게 배우는 웹개발 A to Z v0
3주차
북마크
이*환
댓글
2
추천
0
조회수
14
조회수
14
답변 완료

* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.


영화 이미지 주소: abc 입력

영화 제목: 제목입니다 입력

추천이유: 추천합니다 입력


입력 후 기록하기를 클릭했는데 console창에 아무런 결과도 안뜨고 이런 오류가 나옵니다.

The label's for attribute doesn't match any element id. This might prevent the browser from correctly autofilling the form and accessibility tools from working correctly.

To fix this issue, make sure the label's for attribute references the correct id of a form field.


----------------------------------------------------------------------------------------------------

작성중인 코드입니다.

<!DOCTYPE html>

<html lang="en">


<head>

  <meta charset="UTF-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>스파르타플릭스</title>

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"

    integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">

  <style>

    @import url('https://fonts.googleapis.com/css2?family=Gowun+Dodum&display=swap');


    * {

      font-family: 'Gowun Dodum', sans-serif;

    }


    .main {


      color: white;


      background-image: url('https://occ-0-1123-1217.1.nflxso.net/dnm/api/v6/6AYY37jfdO6hpXcMjf9Yu5cnmO0/AAAABeIfo7VL_VDyKnljV66IkR-4XLb6xpZqhpLSo3JUtbivnEW4s60PD27muH1mdaANM_8rGpgbm6L2oDgA_iELHZLZ2IQjG5lvp5d2.jpg?r=e6e.jpg');

      background-position: center;

      background-size: cover;

    }


    body {

      background-color: black;

    }


    .mycards {

      width: 1200px;

      margin: 20px auto 20px auto;

    }


    .mypostingbox {

      width: 500px;

      margin: 20px auto 20px auto;


      border: 1px solid white;

      padding: 20px;

      border-radius: 5px;

    }


    .form-floating>input {

      background-color: transparent;

      color: white;

    }


    .form-floating>label {

      color: white;

    }


    .input-group>label {

      background-color: transparent;

      color: white;

    }


    .mypostingbox>button {

      width: 100%;

    }

  </style>

  <script>



    function openclose() {

      $('#postingbox').toggle();

    }


    function makeCard() {

      let image = $('#image').val();

      let title = $('#title').val();

      let comment = $('#comment').val();


      console.long(image, tilte, comment);


      let star = $('#star').val();

      

      let temp_html = `      

      <div class="col">

        <div class="card h-100">

          <img src="${image}"

            class="card-img-top" alt="...">

          <div class="card-body">

            <h5 class="card-title">${title}</h5>

            <p class="card-text">${star}</p>

            <p class="card-text">${comment}</p>

          </div>

        </div>

      </div>`

      $('#card').append(temp_html);

    }


  </script>

</head>


<body>

  <header class="p-3 text-bg-dark">

    <div class="container">

      <div class="d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start">

        <a href="/" class="d-flex align-items-center mb-2 mb-lg-0 text-white text-decoration-none">

          <svg class="bi me-2" width="40" height="32" role="img" aria-label="Bootstrap">

            <use xlink:href="#bootstrap"></use>

          </svg>

        </a>


        <ul class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0">

          <li><a href="#" class="nav-link px-2 text-danger">spartaflix</a></li>

          <li><a href="#" class="nav-link px-2 text-white"></a></li>

          <li><a href="#" class="nav-link px-2 text-white">시리즈</a></li>

          <li><a href="#" class="nav-link px-2 text-white">영화</a></li>

          <li><a href="#" class="nav-link px-2 text-white">내가 찜한 콘텐츠</a></li>

        </ul>


        <form class="col-12 col-lg-auto mb-3 mb-lg-0 me-lg-3" role="search">

          <input type="search" class="form-control form-control-dark text-bg-dark" placeholder="Search..."

            aria-label="Search">

        </form>


        <div class="text-end">

          <button type="button" class="btn btn-outline-light me-2">Login</button>

          <button type="button" class="btn btn-danger">Sign-up</button>

        </div>

      </div>

    </div>

  </header>

  <div class="main">

    <div class="p-5 mb-4 bg-body-tertiary rounded-3">

      <div class="container-fluid py-5">

        <h1 class="display-5 fw-bold">킹덤</h1>

        <p class="col-md-8 fs-4">병든 왕을 둘러싸고 흉흉한 소문이 떠돈다. 어둠에 뒤덮인 조선, 기이한 역병에 신음하는 산하. 정체 모를 악에 맞서 백성을 구원할 희망은 오직

          세자뿐이다.</p>

        <button onclick="openclose()"type="button" class="btn btn-outline-light">영화 기록하기</button>

        <button type="button" class="btn btn-outline-light">상세정보</button>

      </div>

    </div>

  </div>


  <div class="mypostingbox" id="postingbox">

    <div class="form-floating mb-3">

      <input type="email" class="form-control" id="image" placeholder="영화 이미지 주소">

      <label for="floatingInput">영화 이미지 주소</label>

    </div>


    <div class="form-floating mb-3">

      <input type="email" class="form-control" id="title" placeholder="영화 제목">

      <label for="floatingInput">영화 제목</label>

    </div>


    <div class="input-group mb-3">

      <label class="input-group-text" for="inputGroupSelect01">별점</label>

      <select class="form-select" id="star">

        <option selected>별점 선택</option>

        <option value="1"></option>

        <option value="2">⭐⭐</option>

        <option value="3">⭐⭐⭐</option>

        <option value="4">⭐⭐⭐⭐</option>

        <option value="5">⭐⭐⭐⭐⭐</option>

      </select>

    </div>

    <button type="button" class="btn btn-danger">기록하기</button>


    <div class="form-floating mb-3">

      <input type="email" class="form-control" id="comment" placeholder="추천 이유">

      <label for="floatingInput">추천 이유</label>

    </div>



  </div>


  <div class="mycards">

    <div id="card" class="row row-cols-1 row-cols-md-4 g-4">

      <div class="col">

        <div class="card h-100">

          <img src="https://movie-phinf.pstatic.net/20210728_221/1627440327667GyoYj_JPEG/movie_image.jpg"

            class="card-img-top" alt="...">

          <div class="card-body">

            <h5 class="card-title">영화 제목</h5>

            <p class="card-text">⭐⭐⭐</p>

            <p class="card-text">영화 코멘트</p>

          </div>

        </div>

      </div>

      <div class="col">

        <div class="card h-100">

          <img src="https://movie-phinf.pstatic.net/20210728_221/1627440327667GyoYj_JPEG/movie_image.jpg"

            class="card-img-top" alt="...">

          <div class="card-body">

            <h5 class="card-title">영화 제목</h5>

            <p class="card-text">⭐⭐⭐</p>

            <p class="card-text">영화 코멘트</p>

          </div>

        </div>

      </div>

      <div class="col">

        <div class="card h-100">

          <img src="https://movie-phinf.pstatic.net/20210728_221/1627440327667GyoYj_JPEG/movie_image.jpg"

            class="card-img-top" alt="...">

          <div class="card-body">

            <h5 class="card-title">영화 제목</h5>

            <p class="card-text">⭐⭐⭐</p>

            <p class="card-text">영화 코멘트</p>

          </div>

        </div>

      </div>

      <div class="col">

        <div class="card h-100">

          <img src="https://movie-phinf.pstatic.net/20210728_221/1627440327667GyoYj_JPEG/movie_image.jpg"

            class="card-img-top" alt="...">

          <div class="card-body">

            <h5 class="card-title">영화 제목</h5>

            <p class="card-text">⭐⭐⭐</p>

            <p class="card-text">영화 코멘트</p>

          </div>

        </div>

      </div>

    </div>

  </div>

</body>


</html>







작성한 코드 및 에러 메세지

오류 발생 시, 작성한 코드 전체와 에러 메시지를 첨부해 주세요.

Tip 1) </> 아이콘을 눌러 코드박스를만들어 보세요.

Tip 2) Ctrl+A(맥의 경우 Command+A) 단축키로 코드를 한 번에 선택할 수 있어요!



취소
 공유
취소
댓글 0
댓글 알림
나의얼굴