HTML 파트 3

발행: (2026년 3월 26일 오후 03:17 GMT+9)
2 분 소요
원문: Dev.to

Source: Dev.to

Label

A “ tells the user what to enter in an input box.
It is best to connect the label with the input using for and id. When the user clicks the label, the associated input receives focus.

<label for="email">Email:</label>
<input type="email" id="email" name="email">

<label for="pwd">Password:</label>
<input type="password" id="pwd" name="pwd">

Button

A “ performs an action when clicked, such as submitting or resetting a form.

Types

  • Default buttonClick Me
  • Button with explicit typeNormal
  • Submit buttonSubmit
  • Reset buttonReset
<button>Click Me</button>
<button type="button">Normal</button>
<button type="submit">Submit</button>
<button type="reset">Reset</button>

Select (Dropdown)

A “ creates a drop‑down list that allows users to choose one or more options.

Single selection

<label for="city">Choose City:</label>
<select id="city" name="city">
  <option>Chennai</option>
  <option>Delhi</option>
  <option>Mumbai</option>
</select>

You can also provide explicit values that are sent to the server:

<select name="city">
  <option value="chennai">Chennai</option>
  <option value="delhi">Delhi</option>
</select>

Multiple selection

<select name="skills" multiple>
  <option>HTML</option>
  <option>CSS</option>
  <option>JavaScript</option>
</select>

Option

defines the items inside a. You can set a default selection, disable an option, or leave the value empty.

<select name="course">
  <option selected>Select Course</option>
  <option>HTML</option>
  <option>CSS</option>
  <option>JavaScript</option>
</select>

Textarea

A “ allows multiline input from the user.

<label for="feedback">Feedback:</label>
<textarea id="feedback" name="feedback"></textarea>

<button type="submit">Submit</button>
0 조회
Back to Blog

관련 글

더 보기 »

태그 <html>: 당신의 웹 우주

만약 당신의 웹사이트가 살아있는 유기체라면, 태그는 그 모든 것을 감싸는 피부와 같습니다. 그것은 루트(root) 요소이며, 페이지에서 절대 없어서는 안 되는 존재입니다.