要素を作る

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META http-equiv="Content-Style-Type" content="text/css">
<script type="text/javascript">
<!--
function func() {
    var ement = document.getElementById("id001");
  var ementP = document.createElement('p');
    ementP.innerHTML= '123';
    ement.appendChild(ementP);
}
window.onload = func;
// -->
</script>
<BODY>
<div id="id001"></div>
</BODY>
</HTML>

0 件のコメント: