<html>
<head>
<script>
window.onload=function(){
b.onclick=function(){
var fontTag=document.createElement("font");
fontTag.color="blue";
fontTag.innerHTML="bbb";
bodyTag.appendChild(fontTag);
}
}
</script>
</head>
<body id="bodyTag">
<font color="red">aaa</font>
<input type="button" id="b">
</body>
</html>
'개발하자 > 자바스크립트' 카테고리의 다른 글
appendChild를 이용하여 td추가하기 (0) | 2015.02.26 |
---|---|
태그생성해서 추가하기 (0) | 2015.02.26 |
document 객체 (0) | 2015.02.26 |
select 한 option 값을 이용해서 배경색바꾸기 onchange사용의 예 (0) | 2015.02.26 |
주소선택해서 이전창으로 불러오기 (0) | 2015.02.26 |