HTML의 부울 속성

작성자

카테고리:

← 피드로
DEV Community · Jaisurya · 2026-07-19 개발(SW)

Jaisurya

The three of the most common boolean attributes that we use in HTML.

Disabled:
When you add it to a form element, you completely shut down any interaction with it.Form inputs that depend on a previous action. For example, keeping a “Submit” button disabled until the user checks a “Terms of Service” box.

<button type="submit" disabled>Submit Application</button>

Enter fullscreen mode Exit fullscreen mode

Required:
It tells the browser that this field must have a value before the form can be submitted. If a user tries to click submit while a required field is empty, the browser blocks the submission and pops up a native warning message.

<input type="email" name="user_email" required>

Enter fullscreen mode Exit fullscreen mode

**
Readonly:**
The readonly attribute is the most unique of the three and is often confused with disabled.Pre-filled data that the user needs to see (and maybe copy), but shouldn’t alter. For example, an order summary page showing a calculated grand total or a system-generated account ID.

<input type="text" name="account_id" value="A99281" readonly>

Enter fullscreen mode Exit fullscreen mode

원문에서 계속 ↗

추출 본문 · 출처: dev.to · https://dev.to/jaisurya/boolean-attributes-in-html-3315

코멘트

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다