: 고유한 식별 (= 중복 불가능) 을 목적으로 하는 경우에 사용된다.
document.getElementId() 를 통해 고유 영역을 참조할 수 있다.<section id = 'front-end-news'>
<h1>프론트엔드 뉴스</h1>
...
</section>
<section id = 'front-end-heros'>
<h1>프론트엔드 개발 히어로즈</h1>
...
</section>
<label for = 'name' > 이름 : </label>
<input id = 'name' type = 'text'>
<p hidden id="table-desc">표 설명(요약)</p>
<!--표 요소의 aria-describedby 속성과 연결된 표 설명-->
<table aria-describedby="table-desc">
<caption>표 제목</caption>
...
</table>
: css 쿼리문 및 재사용을 목적으로 하는 경우 사용
<button type='button' class = 'button'> 읽기 </button>
<input type = 'button' class = 'button' value = '읽기'>
<a href = 'http:/...' class = 'button'> 읽기 </a>

요소의 유형과 상관없이 class = 'button'이 설정되면 일관된 디자인이 반영된다.
<!-- 고정 너비를 가진 컨테이너 스타일을 반영하기 위한 식별자 -->
<div class="container">
...
</div>
<!-- 컨테이너 요소의 너비를 유연(fluid)하게 변경하는 식별자 추가 -->
<div class="container is-fluid">
...
</div>
: form 컨트롤 요소의 값(value)을 서버로 전송하기 위해 필요한 속성
<select> 요소에 설정된 값을 식별하기 위한 이름<form>
<div class="select">
<label for="source-of-info">정보 출처</label>
<select
name="source-of-info"
id="source-of-info">
<option>정보 출처를 선택해주세요.</option>
<option>페이스북</option>
<option>트위터</option>
<option selected>인스타그램</option>
...
</select>
</div>
...
</form>
var form = document.querySelector('form');
var formData = new FormData(form);
// name="source-of-info" 정보 값을 출력 ➡️ 인스타그램
formData.get('source-of-info');
1) 어떤 객체에 있어 id는 자바스크립트의 getElementById를 활용할 때 사용된다.
2) 폼태그에 있어 name은 폼값을 넘기기 위해서 사용된다.
3) 따라서, 폼값을 굳이 넘겨야 할 필요가 없는 폼에 name은 유용하지 않다.
📎 참고 사이트 : id, name, class 속성에 대한 사용법이 궁금합니다.