ถาม javascript หน่อยครับ กดรูปเเล้วให้ขึ้นที่ td ยังไงครับ
ถาม-ตอบ แนะนำไอเดียว โค้ดตัวอย่าง แนวทาง วิธีแก้ปัญหา ถาม javascript หน่อยครับ กดรูปเเล้วให้ขึ้นที่ td ยังไงครับ
ถาม javascript หน่อยครับ กดรูปเเล้วให้ขึ้นที่ td ยังไงครับ
กดรูปหรือเลขด้านล่าง เเล้วใช้มันโชว์ตางรางเเรก กด3ทีขึ้นตารางเเรก กดอีก3ทีก็ให้ขึ้นตารางถัดไป

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | <!DOCTYPE html> <html lang= "en" > <head> <meta charset= "UTF-8" > <meta name= "viewport" content= "width=device-width, initial-scale=1.0" > <meta http-equiv= "X-UA-Compatible" content= "ie=edge" > <title>Document</title> <!-- <link rel= "stylesheet" type= "text/css" href= "style.css" > --> <style> *{ margin: 0; padding: 0; } table, th { border: 1px solid black; border-collapse: collapse; text-align: center; width: 100%; } td { border: 1px solid black; border-collapse: collapse; width: 40px; height: 40px; } .set1 { border: none; outline: none; padding: 10px 16px; background-color: #f1f1f1; cursor: pointer; font-size: 18px; } /* Style the active class, and buttons on mouse-over */ .active, .set1:hover { background-color: #666; color: white; } div.f1{ width: 1000px; } </style> </head> <body> <script> myFunction = i => $( ".demo1 td:empty:first" ).html($(i).html()); </script> <div > <table width= "1000" class= "demo1" style= "background-color:#E6E6E6" > <tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr> </table> </div> <div class= "f1" > <table> <tbody> <tr> <td id= "test1" > <table style= "border: 0px;" > <tbody> <tr onclick= "myFunction(this)" > <td width= "50%" class= "set1" style= "border: 0px;" >1</td> <td width= "50%" class= "set1" style= "border: 0px;" ><img width= "50" height= "50" src= "img/number1.png" ></td> </tr> </tbody> </table> </td> <td id= "test2" > <table style= "border: 0px;" > <tbody> <tr onclick= "myFunction(this)" > <td width= "50%" class= "set1" style= "border: 0px;" >2</td> <td width= "50%" class= "set1" style= "border: 0px;" ><img width= "50" height= "50" src= "img/number2.png" ></td> </tr> </tbody> </table> </td> <td id= "test1" > <table style= "border: 0px;" > <tbody> <tr onclick= "myFunction(this)" > <td width= "50%" class= "set1" style= "border: 0px;" >3</td> <td width= "50%" class= "set1" style= "border: 0px;" ><img width= "50" height= "50" src= "img/number3.png" ></td> </tr> </tbody> </table> </td> <td id= "test1" > <table style= "border: 0px;" > <tbody> <tr onclick= "myFunction(this)" > <td width= "50%" class= "set1" style= "border: 0px;" >4</td> <td width= "50%" class= "set1" style= "border: 0px;" ><img width= "50" height= "50" src= "img/number4.png" ></td> </tr> </tbody> </table> </td> <td id= "test1" > <table style= "border: 0px;" > <tbody> <tr onclick= "myFunction(this)" > <td width= "50%" class= "set1" style= "border: 0px;" >5</td> <td width= "50%" class= "set1" style= "border: 0px;" ><img width= "50" height= "50" src= "img/number5.png" ></td> </tr> </tbody> </table> </td> <td id= "test1" > <table style= "border: 0px;" > <tbody> <tr onclick= "myFunction(this)" > <td width= "50%" class= "set1" style= "border: 0px;" >6</td> <td width= "50%" class= "set1" style= "border: 0px;" ><img width= "50" height= "50" src= "img/number6.png" ></td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </div> </body> </html> |

คำแนะนำ และการใช้งาน
สมาชิก กรุณา ล็อกอินเข้าระบบ เพื่อตั้งคำถามใหม่ หรือ ตอบคำถาม สมาชิกใหม่ สมัครสมาชิกได้ที่ สมัครสมาชิก
- ถาม-ตอบ กรุณา ล็อกอินเข้าระบบ
ความคิดเห็นที่
11
สมมุติคลิก3ครั้งสีเหลืองออก 1 2 3
ครั้งที่4 กดเลข 4 สีเหลืองที่เลข 1 2 3หาย ยังไม่ติ้ก ถูกผิด
ครั้งที่5 กดเลข 3 ให้ขึ้นติ้กถูก เราจะเช็คยังไงครับว่า เลข 1 2 3 เคยขึ้นสีเหลือง
ผมงงตรงนี้เเหละครับ
ขอบคุณที่มาตอบนะครับ
ครั้งที่4 กดเลข 4 สีเหลืองที่เลข 1 2 3หาย ยังไม่ติ้ก ถูกผิด
ครั้งที่5 กดเลข 3 ให้ขึ้นติ้กถูก เราจะเช็คยังไงครับว่า เลข 1 2 3 เคยขึ้นสีเหลือง
ผมงงตรงนี้เเหละครับ
ขอบคุณที่มาตอบนะครับ

ขอบคุณทุกการสนับสนุน
![]()