-
createElement ex <p> </p> <div id="createElement_dev1"></div> <script> let mv = document.querySelector("#createElement_dev1"); { let e1 = document.createElement("textarea"); mv.appendChild(e1); e1.value = "textarea value"; e1.select(); } { let e1 = document.createElement("a"); mv.appendChild(e1); e1.textContent = "createElement a"; } { let e1 = document.createElement("br"); mv.appendChild(e1); e1.textContent = "createElement br"; } { let e1 = document.createTextNode("createTextNode"); mv.appendChild(e1); } </script>
참고
appendChild
Javascript Ex - appendChild, insertBefore'Html Css JavaScript' 카테고리의 다른 글
async await 개요 (0) 2022.12.24 Html Label (0) 2022.12.01 Javascript 중괄호({}, Braces) (0) 2022.11.25 Javascript Map Ex (0) 2022.11.25 Javascript charAt (0) 2022.11.25 Javascript Eval (0) 2022.11.25 Javascript encodeUri decodeUri Component (0) 2022.11.25 예제 grid-template-gap box-shadow (0) 2022.11.24