HTML 목록 속성은 HTML 문서의 요소에 대해 미리 정의된 옵션을 포함하는
구문
다음은 구문입니다 -
<input list=”text”>
HTML 목록 속성의 예를 살펴보겠습니다.
예시
<!DOCTYPE html>
<html>
<style>
body {
color: #000;
height: 100vh;
background-color: #8BC6EC;
background-image: linear-gradient(135deg, #8BC6EC 0%, #9599E2 100%);
text-align: center;
}
input {
display: block;
width: 60%;
margin: 1rem auto;
}
</style>
<body>
<h1>HTML list Attribute Demo</h1>
<input list="subject" placeholder='Select your elective subject'>
<datalist id='subject'>
<option>Maths</option>
<option>Physics</option>
<option>Economics</option>
</datalist>
</body>
</html> 출력
