2010. 4. 8. 09:56
JavaScript
<html>
<head>
<script languge="javacript">
function createRowAndCell(){
var mtable=document.getElementById("myTable");
var firstRow=mtable.insertRow(0);
var firstCell=firstRow.insertCell(0);
firstCell.colSpan="2";
firstCell.height="1";
firstCell.bgColor="#AAC2E1";
var secondRow=mtable.insertRow(1);
var second1Cell=secondRow.insertCell(0);
second1Cell.innerHTML="dddd";
var second2Cell=secondRow.insertCell(1);
second2Cell.innerHTML="ㅋㅋㅋ";
alert("1.1 번째 글짜바뀜");
mtable.rows[1].cells[1].innerHTML="ㄷㄷㄷㄷㄷ";
}
</script>
</head>
<body>
<button onclick="createRowAndCell();">dddd</button>
<table id="mytable">
<tr>
<td height="1" colSpan="2" bgColor="#AAC2E1"></td>
</tr>
<tr>
<td>
111
</td>
<td>
222
</td>
</tr>
</table>
</body>
</html>
<head>
<script languge="javacript">
function createRowAndCell(){
var mtable=document.getElementById("myTable");
var firstRow=mtable.insertRow(0);
var firstCell=firstRow.insertCell(0);
firstCell.colSpan="2";
firstCell.height="1";
firstCell.bgColor="#AAC2E1";
var secondRow=mtable.insertRow(1);
var second1Cell=secondRow.insertCell(0);
second1Cell.innerHTML="dddd";
var second2Cell=secondRow.insertCell(1);
second2Cell.innerHTML="ㅋㅋㅋ";
alert("1.1 번째 글짜바뀜");
mtable.rows[1].cells[1].innerHTML="ㄷㄷㄷㄷㄷ";
}
</script>
</head>
<body>
<button onclick="createRowAndCell();">dddd</button>
<table id="mytable">
<tr>
<td height="1" colSpan="2" bgColor="#AAC2E1"></td>
</tr>
<tr>
<td>
111
</td>
<td>
222
</td>
</tr>
</table>
</body>
</html>
'JavaScript' 카테고리의 다른 글
자바스크립트 리플레이스all (0) | 2011.03.10 |
---|---|
onClick 안에 javascript 삽입, 다이얼로그창 띄우고 ok시 링크쫒아가게 하기,팝업 띄우기 (0) | 2010.04.09 |
div 테그 (0) | 2010.04.02 |
현제 쿠키값 보기 (0) | 2010.03.02 |
자식창에서 부모창 함수 실행 (0) | 2010.01.29 |