[자바스크립트] JS로 HTML 태그 만들기
0
자바스크립트에서 document.body 를 하면, html의 body 부분이 선택된다.
document.createElement() 메서드를 사용해 html 태그를 만들 수 있다.
document.body.append() 를 사용해야, 만들어낸 html 태그를 body에 추가해준다.
textContent 로 태그 안에 들어가는 글자를 넣어준다.
답변 0
자바스크립트에서 document.body 를 하면, html의 body 부분이 선택된다.
document.createElement() 메서드를 사용해 html 태그를 만들 수 있다.
document.body.append() 를 사용해야, 만들어낸 html 태그를 body에 추가해준다.
textContent 로 태그 안에 들어가는 글자를 넣어준다.
답변 0