I/T/JavaScript2009.09.24 10:26
<SPAN id=tx_marker_caret></SPAN><SPAN id=tx_marker_caret></SPAN><?xml version="1.0" encoding="EUC-KR" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR" />
		<title>Array function example</title>
		
		<script type="text/javascript">
			var myArray = new Array();
			var titleArray = new Array("Student Number", "Name", "Grade");
			
			i = 0;
			k = 0;
			flag = 0;
			
			while(confirm("Do you want input new student?")) {
				myArray[i] = new Array();
				
				for(j=0 ; j<3 ; j++) {
					myArray[i][j] = prompt("Input " + titleArray[j], "");
				}
				i++;
			}
			
			document.write("" +
				"<table border='1' widhth='500'>" +
				"<tr><td>St Number</td><td>Name</td><td>Grade</td></tr>");
				
			for(i=0 ; i<myArray.length ; i++) {
				document.write("<tr>");
				for(j=0 ; j<myArray[i].length ; j++) {
					document.write("<td>" + myArray[i][j] + "</td>");
				}
				document.write("</tr>");
			}
			
			document.write("</table>");
		</script>
	</head>
	<body>
	
	</body>
</html>

저작자 표시 비영리 변경 금지
신고

'I/T > JavaScript' 카테고리의 다른 글

JavaScript Input(Radio) Element  (0) 2010.06.03
Javascript escape&unescape  (0) 2009.09.24
Javascript Array 사용법  (0) 2009.09.24
Javascript switch문 사용법  (0) 2009.06.16
Javascript if문 사용법  (0) 2009.06.16
Javascript for문 사용법  (0) 2009.06.16
Posted by 황타

티스토리 툴바