appendChild
指定されたオブジェクトの末尾にノードを追加します。
構文
オブジェクト.appendChild(末尾に追加するノード)
例文
<html>
<head>
<title>appendChild</title>
<script type="text/javascript"><!--
window.onload = function() {
var textObj = document.createTextNode("DOM Sample");
document.getElementById("result").appendChild(textObj);
}
// --></script>
</head>
<body>
<div id="result"></div>
</body>
</html>
関連記事
- previousSibling
- parentNode
- nextSibling
- lastChild
- item
- insertBefore
- hasChildNodes
- getElementsByTagName
- getElementsByName
- getElementById
- firstChild
- createTextNode
- document.createElement
- cloneNode
- childNodes
スポンサーリンク





