자바 스크립트 초보 질문요 ㅜㅜ

자바 스크립트 초보 질문요 ㅜㅜ

작성일 2008.05.11댓글 1건
    게시물 수정 , 삭제는 로그인 필요

제가 야구게임을 만들려고하는데요 테이블 세번째칸에 있는 숫자이미지를 클릭하면 테이블

두번째칸에 있는 첫번째 칸에 출력이 되고 또 누르면 두번째 또 누르면 세번째 칸에 출력이 되야 하는데

아무리 생각해봐도 모르겟어요 우선 첫번째칸에는 출력이 되는데요 그걸 받고 두번째 누르면

두번째칸 세번째 누르면 세번째 칸에 출력되도록 하는 방법 좀 알려주세요 부탁 드립니다 ㅜㅜ

 

이건 제가 만든 소스예요

<html>
<head><title></title></head>
 <style type="text/css">
 
 </style>

 <script language="javascript">
 
 function test(value)
 {
  /*var a=new Array[3]
  for(i=0;i<a.length;i++)
  {
   a[i]
  }*/
  document.getElementById('out').innerHTML = value;
 }
 </script>
<body>
<br>
<table border=0 align=center backimage=""img\enter.bmp">
    <tr>
  <td colspan=10><marquee scrollamount=1 direction="right" behavior="alternate"><b>Baseball Game</marquee></td>
 <tr>
  <td colspan=2><marquee direction="right" behavior="alternate"><img src="img\empty1.bmp"><img src="img\empty2.bmp"><img src="img\empty3.bmp"><img src="img\empty4.bmp"><img src="img\empty5.bmp"><img src="img\empty6.bmp"><img src="img\empty7.bmp"><img src="img\empty8.bmp"><img src="img\empty9.bmp"></marquee></td>
  <td colspan=2><div id="out" align="center" style="background:red;border-style:solid;"></div></td>
  <td colspan=2><div id="out" align="center" style="background:red;border-style:solid;"></div></td>
  <td colspan=2><div id="out" align="center" style="background:red;border-style:solid;"></div></td>
  <td colspan=2><marquee direction="left" behavior="alternate"><img src="img\empty9.bmp"><img src="img\empty8.bmp"><img src="img\empty7.bmp"><img src="img\empty6.bmp"><img src="img\empty5.bmp"><img src="img\empty4.bmp"><img src="img\empty3.bmp"><img src="img\empty2.bmp"><img src="img\empty1.bmp"></marquee></td>
 </tr>
 <tr>
  <td><input type="image" src="img\1.bmp" value="1" onClick="test(value)"></td>
  <td><input type="image" src="img\2.bmp" value="2" onClick="test(value)"></td>
  <td><input type="image" src="img\3.bmp" value="3" onClick="test(value)"></td>
  <td><input type="image" src="img\4.bmp" value="4" onClick="test(value)"></td>
  <td><input type="image" src="img\5.bmp" value="5" onClick="test(value)"></td>
  <td><input type="image" src="img\6.bmp" value="6" onClick="test(value)"></td>
  <td><input type="image" src="img\7.bmp" value="7" onClick="test(value)"></td>
  <td><input type="image" src="img\8.bmp" value="8" onClick="test(value)"></td>
  <td><input type="image" src="img\9.bmp" value="9" onClick="test(value)"></td>
  <td><input type="image" src="img\enter.bmp" value="확인" onClick="test(value)"></td>
 </tr>
 <tr>
  <td colspan=10 height=300 bgcolor="6666ff"><div id="out" style="border-style:solid;height:400;">~Select number~</div></td>
 </tr>
</table>
</body>
</html>


#자바 스크립트 #자바 스크립트 소수점 버림 #자바 스크립트 문법 #자바 스크립트 기초 #자바 스크립트 다운로드 #자바 스크립트 배열 #자바 스크립트 오류 #자바 스크립트 주석 #자바 스크립트 실행 #자바 스크립트 자바 차이

profile_image 익명 작성일 -

──────────────────────────────────────────────────

 

 

 

──────────────────────────────────────────────────

 [예 제-1]
 

<html>
<head><title></title></head>
 <style type="text/css">
 .td_style { background:red;font-size:23pt;border-style:solid }
 </style>

 <script language="javascript">
 var index = 0;
 function test(value)
 {
  var output = document.getElementsByName('out');
  output[index++].innerText=value;
  if(index == 3){ alert("다음은 무엇을 하실거죠?"); index = 0; }
 }
 </script>
<body>
<br>
<table border=0 align="center" background="">
    <tr>
  <td colspan=10><marquee scrollamount=1 direction="right" behavior="alternate"><b>Baseball Game</marquee></td>
 <tr>
  <td colspan=2><marquee direction="right" behavior="alternate"><img src="img\empty1.bmp"><img src="img\empty2.bmp"><img src="img\empty3.bmp"><img src="img\empty4.bmp"><img src="img\empty5.bmp"><img src="img\empty6.bmp"><img src="img\empty7.bmp"><img src="img\empty8.bmp"><img src="img\empty9.bmp"></marquee></td>
  <td colspan=2 align="center" class="td_style" id="out">&nbsp;</td>
  <td colspan=2 align="center" class="td_style" id="out">&nbsp;</td>
  <td colspan=2 align="center" class="td_style" id="out">&nbsp;</td>
  <td colspan=2><marquee direction="left" behavior="alternate"><img src="img\empty9.bmp"><img src="img\empty8.bmp"><img src="img\empty7.bmp"><img src="img\empty6.bmp"><img src="img\empty5.bmp"><img src="img\empty4.bmp"><img src="img\empty3.bmp"><img src="img\empty2.bmp"><img src="img\empty1.bmp"></marquee></td>
 </tr>
 <tr>
  <td><img src="img\1.bmp" onClick="test(1)"></td>
  <td><img src="img\1.bmp" onClick="test(2)"></td>
  <td><img src="img\1.bmp" onClick="test(3)"></td>
  <td><img src="img\1.bmp" onClick="test(4)"></td>
  <td><img src="img\1.bmp" onClick="test(5)"></td>
  <td><img src="img\1.bmp" onClick="test(6)"></td>
  <td><img src="img\1.bmp" onClick="test(7)"></td>
  <td><img src="img\1.bmp" onClick="test(8)"></td>
  <td><img src="img\1.bmp" onClick="test(9)"></td>

  <td><input type="image" src="img\enter.bmp" value="확인" onClick="test(value)"></td>
 </tr>
 <tr>
  <td colspan=10 height=300 bgcolor="6666ff"><div id="out" style="border-style:solid;height:400;">~Select number~</div></td>
 </tr>
</table>
</body>
</html>

 

자바 스크립트 초보 질문요 ㅜㅜ

... 드립니다 ㅜㅜ 이건 제가 만든 소스예요 function test(value) { /*var a=new Array[3] for(i=0;i<a.length;i++) { a[i] }*/ document.getElementById('out').innerHTML...

초보 자바스크립트 질문이요~ㅜㅜ

... 할려하는데..ㅜㅜ어떻게하죠? 로그인 버튼을 클릭했을 때 myfounction() 함수를 호출해야겠죠. 그리고 if (form.uID.value==" ")에서 " "와 같이 따옴표와...