속성제어 : 속성은 attributue,
ex)href, src, alt 등등
getAttribute : 속성의 값을 가져오기(보여주기)
setAttribute : 속성의 값을 변경하기
ex)예시
<a href = "https://www.naver.com" target = "_blank" title = "네이버로 이동"> 네이버 </a>
const a = document.querySelector("a");
const a_href = a.getAttribute("href");
console.log(a_href);
// 네이버 주소 출력 됨.
const a_title = a.getAttribute("title");
console.log(a_title);
// "네이버로 이동" 이 출력됨
a.setAttribute("href", "https://www.nate.com");
a.setAttribute("target", "_self");
// target이 _blank 에서 _self로 바뀜
a.setAttribute("title", "네이트로 이동");
// title이 네이버로 이동 -> 네이트로 이동 으로 바뀜
a.innerText = "네이트"
//a태그 안의 텍스트("네이버")를 네이트로 변경시킴