HTML 폼관련 요소

IM SU KYUNG·2022년 4월 1일
0

1. form

: 정보를 제출하기 위한 대화형 컨트롤을 포함하는 문서구획
ex) 회원가입, 설문조사 등

<form action =" " method = "  ">
action : 주소값 (데이터를 보내지는 주소값)
method : 양식 제출 (bost, het(개인정보 작성시 사용안함), dialog)

: form이 다른 form을 자식 요소로 포함할 수 없다.
⚬ action 전송한 정보를 처리할 웹페이지의 URL
⚬ autocomplete 사용자가 이전에 입력한 값으로 자동 완성 기능을 사용할 것인지 여부
⚬ method 서버로 전송할 HTTP 방식
⚬ name 고유한 양식의 이름
⚬ novalidate 서버로 전송시 양식 데이터의 유효성을 검사하지 않도록 지정
⚬ target 서버로 전송 후 응답받을 방식을 지정

> : label, input(input에 사용자 정보를 입력하고 여러 항목을 넣을 수있다. )

<div class="preference">
   <label for="name">Enter your name</label>
   <input type="checkbox" name="cheese" id="cheese">
</div>
<div>
    <label for = "foodname"> 음식이름 </label>
    <input type="text" name="food" id="foodname"></input>
</div>

👉🏻 위 아래 모두 동일하게 동작함 
👉🏻 대신 음식이름, 색깔이 text로 입력해야한다. 

<div>
    <input> 색깔 
    <input type="text" name="color">
    </label>>
</div>

2. button

: 클릭이 가능한 버튼

<button class="favorite styled"
        type="button">
    Add to favorites
</button>

✅ 공부하면서 채워나가기!

profile
Front-end web developer🌳

0개의 댓글