메뉴 건너뛰기

asdf2019.08.22 16:54
<!DOCTYPE html>
<html>
<head>
<title>마우스 클릭 연습</title>
<style>
table { border : 1px solid blue; border-collapse : collapse; }
tr, td { border : 1px solid blue; width : 50px; height : 50px; }
</style>

<script>
var last;
function randomMove() {
var i = Math.floor(Math.random()*100);
document.images[i].src="apple.png";
last = i;
}

function clickMove(e){

document.images[last].src="";
randomMove();

}
</script>
</head>

<body onload="randomMove()">
<h2>마우스 클릭 연습</h2>
<hr>
<script>

document.write("<table>");
for(var i = 0; i<10; i++) {
document.write("<tr>");
for(var j=0; j<10; j++) {
document.write("<td>");
document.write("<img src="" onclick="clickMove(event)">");
document.write("</td>");
}
document.write("</tr>");
}
document.write("</table>");

</script>
</body>
</html>

코드를 이렇게 수정해보아도 브라우저상에 테이블이 보이질않는대 혹시 무슨 문제라도 있는건가요???
<head>태그 안에도 <script>태그가 있고 <body>태그안에도 <script>태그가 있어서 그런건가요??
파일 첨부

여기에 파일을 끌어 놓거나 파일 첨부 버튼을 클릭하세요.

파일 크기 제한 : 0MB (허용 확장자 : *.*)

0개 첨부 됨 ( / )
위로