U E D R , A S I H C RSS

JavaScript/2011년스터디/김수경 (rev. 1.6)

Java Script/2011년스터디/김수경

11일

  • 2011.html

<html>
<head>
<title>Javascript</title>
   <script src="gugu.js" type="text/javascript"></script>
   <link rel="stylesheet" type="text/css" href="2011.css" />
</head>
<body onload="gu();">
//<body onload="s();">
</body>
</html>
  • gugu.js

function gugu(dan){
    for(var i = 1; i <= 9; i++){
        document.write(dan + " X " + i + " = " + (dan * i) + "<br/>");
    }
}

function gu(){
    for(var i = 2; i <= 9; i++){
        gugu(i);
        document.write("<br/>");
    }
}

function g(){
    for(var i = 2; i <= 9; i++){
        for(var j = 1; j <= 9; j++){
           document.write(i + " X " + j + " = " + (i * j) + "<br/>");
        }
        document.write("<br/>");
    }
}
  • sum.js

function s(){
    var score = {"지혜":{"국어":90, "수학":90},"수경":{"국어":90, "수학":40}, "정근":{"국어":80, "수학":100}};
    for(var i in score){
        document.write("<" + i + "><br/>");
        for(var j in score[i]){
            document.write(j + " : " + score[i][j] + "<br/>");
        }
    }
}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:23:30
Processing time 0.0444 sec