In order to work with jQuery, you should be aware of the basics of JavaScript, HTML and CSS. Before I start this tutorial, I assume that you are familiar with HTML, CSS and jQuery. I also assume that you know what jQuery is and how to use it in your pages.

Where to download?

jQuery scripting file can be downloaded from jQuery Official website:

Chapter 1

In this chapter I will show you how you can create interactive game using jQuery, HTML 5 and CSS3 through step by step approch. It consists three major parts.

  1. Creating HTML elements
  2. Styling with CSS
  3. Scripting with JQuery

Process flow diagram

The following figure defines the entire process flow diagram:

Process flow diagram
Figure 1: Process flow diagram

Part 1: HTML

Before I start this tutorial, I assume that you are familiar with HTML, CSS and jQuery. I also assume that you understand what jQuery is and how to use it in your pages.

Use basic HTML code to create the HTML elements. The following is the HTML code I have used in this tutorial.

  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. </head>
  6. <body <form>
  7. <img src="Images/bulb_mind_brain_svg-256.png" alt="hi" style="width:256px;height:256px;">
  8. <br>
  9. <br>
  10. <div style="text-align:center;">
  11. <div id="scr">YOUR SCORE : </div>
  12. <div id="output">00</div>
  13. </div>
  14. <br>
  15. <br>
  16. <br>
  17. <input type="button" class="styled-button-2" id="btnShowSimple" value="START" />
  18. <input type="button" class="styled-button-2" id="btnShowModal" value="RESTART" />
  19. <br />
  20. <br />
  21. <div id="output"></div>
  22. <div id="overlay" class="web_dialog_overlay"></div>
  23. <div id="dialog" class="web_dialog">
  24. <table style="width: 100%; border: 0px;" cellpadding="3" cellspacing="0">
  25. <tr>
  26. <td class="web_dialog_title"></td>
  27. <td class="web_dialog_title align_right">
  28. <a href="#" id="btnClose">Close</a>
  29. </td>
  30. </tr>
  31. <td> </td>
  32. <td> </td>
  33. <tr>
  34. <td style="text-align: center" ;>
  35. Time Left <b id="countdown"></b> seconds
  36. <img src="Images/Alarm.png" alt="Timer" style="width:48px;height:48px;">
  37. </td>
  38. </tr>
  39. <tr>
  40. <td> </td>
  41. </tr>
  42. <tr>
  43. <td colspan="2" style="padding-left: 15px;">
  44. </td>
  45. </tr>
  46. <tr>
  47. <td> </td>
  48. <td> </td>
  49. </tr>
  50. <tr>
  51. <td colspan="2" style="padding-left: 15px;">
  52. <div id="shuffle">
  53. <div class="cell"></div>
  54. <div class="cell"></div>
  55. <div class="cell"></div>
  56. <div class="cell"></div>
  57. <div class="cell"></div>
  58. <div class="cell"></div>
  59. <div class="cell"></div>
  60. <div class="cell"></div>
  61. <div class="cell"></div>
  62. <div class="cell"></div>
  63. <div class="cell"></div>
  64. <div class="cell"></div>
  65. <div class="cell"></div>
  66. <div class="cell"></div>
  67. <div class="cell"></div>
  68. <div class="cell"></div>
  69. <div class="cell"></div>
  70. <div class="cell"></div>
  71. <div class="cell"></div>
  72. <div class="cell"></div>
  73. <div class="cell"></div>
  74. <div class="cell"></div>
  75. <div class="cell"></div>
  76. <div class="cell"></div>
  77. <div class="cell"></div>
  78. <div class="cell"></div>
  79. <div class="cell"></div>
  80. <div class="cell"></div>
  81. <div class="cell"></div>
  82. <div class="cell"></div>
  83. <div class="cell"></div>
  84. <div class="cell"></div>
  85. <div class="cell"></div>
  86. <div class="cell"></div>
  87. <div class="cell"></div>
  88. <div class="cell"></div>
  89. <div class="cell"></div>
  90. <div class="cell"></div>
  91. <div class="cell"></div>
  92. <div class="cell"></div>
  93. <div class="cell"></div>
  94. <div class="cell"></div>
  95. <div class="cell"></div>
  96. <div class="cell"></div>
  97. <div class="cell"></div>
  98. <div class="cell"></div>
  99. <div class="cell"></div>
  100. <div class="cell"></div>
  101. <div class="cell"></div>
  102. <div class="cell"></div>
  103. <div class="cell"></div>
  104. <div class="cell"></div>
  105. <div class="cell"></div>
  106. <div class="cell"></div>
  107. <div class="cell"></div>
  108. <div class="cell"></div>
  109. <div class="cell"></div>
  110. <div class="cell"></div>
  111. <div class="cell"></div>
  112. <div class="cell"></div>
  113. <div class="cell"></div>
  114. <div class="cell"></div>
  115. <div class="cell"></div>
  116. <div class="cell"></div>
  117. <div class="cell"></div>
  118. <div class="cell"></div>
  119. <div class="cell"></div>
  120. <div class="cell"></div>
  121. <div class="cell"></div>
  122. <div class="cell"></div>
  123. <div class="cell"></div>
  124. <div class="cell"></div>
  125. <div class="cell"></div>
  126. <div class="cell"></div>
  127. <div class="cell"></div>
  128. <div class="cell"></div>
  129. <div class="cell"></div>
  130. <div class="cell"></div>
  131. <div class="cell"></div>
  132. <div class="cell"></div>
  133. <div class="cell"></div>
  134. <div class="cell"></div>
  135. <div class="cell"></div>
  136. <div class="cell"></div>
  137. <div class="cell"></div>
  138. <div class="cell"></div>
  139. <div class="cell"></div>
  140. <div class="cell"></div>
  141. <div class="cell"></div>
  142. <div class="cell"></div>
  143. <div class="cell"></div>
  144. <div class="cell"></div>
  145. <div class="cell"></div>
  146. <div class="cell"></div>
  147. <div class="cell"></div>
  148. <div class="cell"></div>
  149. <div class="cell"></div>
  150. <div class="cell"></div>
  151. <div class="cell"></div>
  152. <div class="cell"></div>
  153. </div>
  154. </td>
  155. </tr>
  156. <tr>
  157. <td> </td>
  158. <td> </td>
  159. </tr>
  160. <tr>
  161. <td colspan="2" style="text-align: center;">
  162. <input id="btnSubmit" class="styled-button-3" type="button" value="Exit" />
  163. </td>
  164. </tr>
  165. </table>
  166. </div>
  167. </form>
  168. </body </html>
The preceding HTML code defines the entire page design. Use a different HTML tag to create the entire page design. It contains three major processes. The first process uses a SELECT tag to create a drop down list with data. The second process uses an INPUT tag to create buttons and the third process is an IMG tag to link with the image destination path.

Part 2: CSS

Now I am moving to the second part. The second part process defines CSS code to make the look and feel for all the HTML elements we used before in the HTML part. The following is the CSS code I have used in this tutorial.
  1. <style type="text/css">
  2. html {
  3. text-align: center;
  4. }
  5. #scr,
  6. #output {
  7. display: inline;
  8. font-size: xx-large
  9. }
  10. body {
  11. background-color: Aqua;
  12. }
  13. .styled-button-2 {
  14. -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 0 0;
  15. -moz-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 0 0;
  16. box-shadow: rgba(0, 0, 0, 0.2) 0 1px 0 0;
  17. border-bottom-color: #333;
  18. border: 5px solid GreenYellow;
  19. background-color: Aqua;
  20. border-radius: 10px;
  21. -moz-border-radius: 10px;
  22. -webkit-border-radius: 10px;
  23. color: #333;
  24. font-family: 'Verdana', Arial, sans-serif;
  25. font-size: 14px;
  26. text-shadow: #b2e2f5 0 1px 0;
  27. padding: 10px
  28. }
  29. .styled-button-3 {
  30. -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 0 0;
  31. -moz-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 0 0;
  32. box-shadow: rgba(0, 0, 0, 0.2) 0 1px 0 0;
  33. border-bottom-color: #333;
  34. border: 1px solid #61c4ea;
  35. background-color: Cyan;
  36. border-radius: 5px;
  37. -moz-border-radius: 5px;
  38. -webkit-border-radius: 5px;
  39. color: #333;
  40. font-family: 'Verdana', Arial, sans-serif;
  41. font-size: 14px;
  42. text-shadow: #b2e2f5 0 1px 0;
  43. padding: 5px
  44. }
  45. #shuffle > div {
  46. float: left;
  47. line-height: 30px;
  48. width: 30px;
  49. height: 30px;
  50. background-color: SpringGreen;
  51. border-radius: 4px;
  52. margin: 3px;
  53. }
  54. #shuffle {
  55. background-color: HoneyDew;
  56. max-width: 360px;
  57. line-height: 30px height: 360px;
  58. float: left;
  59. padding: 5px;
  60. max-width: 360px;
  61. }
  62. .highlight {
  63. opacity: 0.7;
  64. filter: alpha(opacity=5);
  65. background-color: #7FFF00;
  66. }
  67. .web_dialog_overlay {
  68. position: fixed;
  69. top: 0;
  70. right: 0;
  71. bottom: 0;
  72. left: 0;
  73. height: 100%;
  74. width: 100%;
  75. margin: 0;
  76. padding: 0;
  77. background: #000000;
  78. opacity: .15;
  79. filter: alpha(opacity=15);
  80. -moz-opacity: .15;
  81. z-index: 101;
  82. display: none;
  83. }
  84. .web_dialog {
  85. display: none;
  86. position: fixed;
  87. width: 390px;
  88. height: 600px;
  89. top: 15%;
  90. left: 50%;
  91. margin-left: -190px;
  92. margin-top: -100px;
  93. background-color: MediumSpringGreen;
  94. border: 5px solid Turquoise;
  95. padding: 0px;
  96. z-index: 102;
  97. font-family: Verdana;
  98. font-size: 10pt;
  99. }
  100. .web_dialog_title {
  101. border-bottom: solid 5px Turquoise;
  102. background-color: Turquoise;
  103. padding: 5px;
  104. color: White;
  105. font-weight: bold;
  106. }
  107. .web_dialog_title a {
  108. color: White;
  109. text-decoration: none;
  110. }
  111. .align_right {
  112. text-align: right;
  113. }
  114. </style>
Before adding the CSS code, make sure it covers the entire browser display area. The preceding CSS code defines the entire HTML element design process.

Part 3: JQuery Scripting

Now I am moving to the third part. This is the final important jQuery scripting code that makes the HTML element functionalities, effects and animations. The following is the jQuery scripting code I have used in this tutorial.

The first step in the jQuery scripting part is to include the required jQuery library reference in the head element of your page.
  1. <script src="http://code.jquery.com/jquery-1.10.2.js"></script>
  2. The following is the complete JQuery and JavaScript code I used in this tutorial.
  3. <script src="http://code.jquery.com/jquery-1.10.2.js"></script>
  4. <script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
  5. <script type="text/javascript">
  6. $(document).ready(function()
  7. {
  8. var $divs = $('.cell').removeClass('highlight');
  9. rnd = Math.floor(Math.random() * $divs.length);
  10. $divs.eq(rnd).addClass('highlight');
  11. var seconds;
  12. $("#btnShowSimple").click(function(e)
  13. {
  14. $("#output").html("00");
  15. function countdown()
  16. {
  17. seconds = 60;
  18. function tick()
  19. {
  20. var counter = document.getElementById('countdown');
  21. seconds--;
  22. counter.innerHTML = "0:" + (seconds < 10 ? "0" : "") + String(seconds);
  23. if (seconds > 0)
  24. {
  25. setTimeout(tick, 1000);
  26. } else
  27. {
  28. alert("Game over");
  29. HideDialog();
  30. }
  31. }
  32. tick();
  33. }
  34. countdown();
  35. ShowDialog(true);
  36. e.preventDefault();
  37. });
  38. $("#btnShowModal").click(function(e)
  39. {
  40. function countdown()
  41. {
  42. seconds = 60;
  43. function tick()
  44. {
  45. var counter = document.getElementById('countdown');
  46. seconds--;
  47. counter.innerHTML = "0:" + (seconds < 10 ? "0" : "") + String(seconds);
  48. if (seconds > 0)
  49. {
  50. setTimeout(tick, 1000);
  51. } else
  52. {
  53. alert("Game over");
  54. HideDialog();
  55. }
  56. }
  57. tick();
  58. }
  59. countdown();
  60. ShowDialog(true);
  61. e.preventDefault();
  62. });
  63. $("#btnClose").click(function(e)
  64. {
  65. HideDialog();
  66. location.reload();
  67. e.preventDefault();
  68. });
  69. $("#btnSubmit").click(function(e)
  70. {
  71. ShowDialog(false);
  72. location.reload();
  73. e.preventDefault();
  74. });
  75. $("#shuffle div").hover(function() {
  76. $(this).css('cursor', 'pointer');
  77. }, function() {
  78. $(this).css('cursor', 'auto');
  79. });
  80. $('.cell').click(function(e)
  81. {
  82. function get_random_color() {
  83. var letters = '0123456789ABCDEF'.split('');
  84. var color = '#';
  85. for (var i = 0; i < 6; i++)
  86. {
  87. color += letters[Math.round(Math.random() * 15)];
  88. }
  89. return color;
  90. }
  91. var className = $(this).attr('class');
  92. if (className == "cell highlight")
  93. {
  94. $('#output').html(function(i, val) {
  95. return val * 1 + 1
  96. });
  97. }
  98. $('.cell').css("background-color", get_random_color());
  99. var rnd;
  100. function highlight()
  101. {
  102. var $divs = $('.cell').removeClass('highlight');
  103. rnd = Math.floor(Math.random() * $divs.length);
  104. $divs.eq(rnd).addClass('highlight');
  105. }
  106. highlight();
  107. });
  108. });
  109. function ShowDialog(modal)
  110. {
  111. $("#overlay").show();
  112. $("#dialog").fadeIn(300);
  113. if (modal)
  114. {
  115. $("#overlay").unbind("click");
  116. } else
  117. {
  118. $("#overlay").click(function(e)
  119. {
  120. HideDialog();
  121. });
  122. }
  123. }
  124. function HideDialog()
  125. {
  126. $("#overlay").hide();
  127. $("#dialog").fadeOut(300);
  128. }
  129. </script>
The preceding jQuery scripting code improves the performance of the application and it defines the entire HTML element UI functionality and effects.

Complete code

The following are the complete HTML, CSS and jQuery scripting codes I used in this tutorial.
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <style type="text/css">
  6. html {
  7. text-align: center;
  8. }
  9. #scr,
  10. #output {
  11. display: inline;
  12. font-size: xx-large
  13. }
  14. body {
  15. background-color: Aqua;
  16. }
  17. .styled-button-2 {
  18. -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 0 0;
  19. -moz-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 0 0;
  20. box-shadow: rgba(0, 0, 0, 0.2) 0 1px 0 0;
  21. border-bottom-color: #333;
  22. border: 5px solid GreenYellow;
  23. background-color: Aqua;
  24. border-radius: 10px;
  25. -moz-border-radius: 10px;
  26. -webkit-border-radius: 10px;
  27. color: #333;
  28. font-family: 'Verdana', Arial, sans-serif;
  29. font-size: 14px;
  30. text-shadow: #b2e2f5 0 1px 0;
  31. padding: 10px
  32. }
  33. .styled-button-3 {
  34. -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 0 0;
  35. -moz-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 0 0;
  36. box-shadow: rgba(0, 0, 0, 0.2) 0 1px 0 0;
  37. border-bottom-color: #333;
  38. border: 1px solid #61c4ea;
  39. background-color: Cyan;
  40. border-radius: 5px;
  41. -moz-border-radius: 5px;
  42. -webkit-border-radius: 5px;
  43. color: #333;
  44. font-family: 'Verdana', Arial, sans-serif;
  45. font-size: 14px;
  46. text-shadow: #b2e2f5 0 1px 0;
  47. padding: 5px
  48. }
  49. #shuffle > div {
  50. float: left;
  51. line-height: 30px;
  52. width: 30px;
  53. height: 30px;
  54. background-color: SpringGreen;
  55. border-radius: 4px;
  56. margin: 3px;
  57. }
  58. #shuffle {
  59. background-color: HoneyDew;
  60. max-width: 360px;
  61. line-height: 30px height: 360px;
  62. float: left;
  63. padding: 5px;
  64. max-width: 360px;
  65. }
  66. .highlight {
  67. opacity: 0.7;
  68. filter: alpha(opacity=5);
  69. background-color: #7FFF00;
  70. }
  71. .web_dialog_overlay {
  72. position: fixed;
  73. top: 0;
  74. right: 0;
  75. bottom: 0;
  76. left: 0;
  77. height: 100%;
  78. width: 100%;
  79. margin: 0;
  80. padding: 0;
  81. background: #000000;
  82. opacity: .15;
  83. filter: alpha(opacity=15);
  84. -moz-opacity: .15;
  85. z-index: 101;
  86. display: none;
  87. }
  88. .web_dialog {
  89. display: none;
  90. position: fixed;
  91. width: 390px;
  92. height: 600px;
  93. top: 15%;
  94. left: 50%;
  95. margin-left: -190px;
  96. margin-top: -100px;
  97. background-color: MediumSpringGreen;
  98. border: 5px solid Turquoise;
  99. padding: 0px;
  100. z-index: 102;
  101. font-family: Verdana;
  102. font-size: 10pt;
  103. }
  104. .web_dialog_title {
  105. border-bottom: solid 5px Turquoise;
  106. background-color: Turquoise;
  107. padding: 5px;
  108. color: White;
  109. font-weight: bold;
  110. }
  111. .web_dialog_title a {
  112. color: White;
  113. text-decoration: none;
  114. }
  115. .align_right {
  116. text-align: right;
  117. }
  118. </style>
  119. <link href="http://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel="stylesheet">
  120. <script src="http://code.jquery.com/jquery-1.10.2.js"></script>
  121. <script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
  122. <script type="text/javascript">
  123. $(document).ready(function()
  124. {
  125. var $divs = $('.cell').removeClass('highlight');
  126. rnd = Math.floor(Math.random() * $divs.length);
  127. $divs.eq(rnd).addClass('highlight');
  128. var seconds;
  129. $("#btnShowSimple").click(function(e)
  130. {
  131. $("#output").html("00");
  132. function countdown()
  133. {
  134. seconds = 60;
  135. function tick()
  136. {
  137. var counter = document.getElementById('countdown');
  138. seconds--;
  139. counter.innerHTML = "0:" + (seconds < 10 ? "0" : "") + String(seconds);
  140. if (seconds > 0)
  141. {
  142. setTimeout(tick, 1000);
  143. } else
  144. {
  145. alert("Game over");
  146. HideDialog();
  147. }
  148. }
  149. tick();
  150. }
  151. countdown();
  152. ShowDialog(true);
  153. e.preventDefault();
  154. });
  155. $("#btnShowModal").click(function(e)
  156. {
  157. function countdown()
  158. {
  159. seconds = 60;
  160. function tick()
  161. {
  162. var counter = document.getElementById('countdown');
  163. seconds--;
  164. counter.innerHTML = "0:" + (seconds < 10 ? "0" : "") + String(seconds);
  165. if (seconds > 0)
  166. {
  167. setTimeout(tick, 1000);
  168. } else
  169. {
  170. alert("Game over");
  171. HideDialog();
  172. }
  173. }
  174. tick();
  175. }
  176. countdown();
  177. ShowDialog(true);
  178. e.preventDefault();
  179. });
  180. $("#btnClose").click(function(e)
  181. {
  182. HideDialog();
  183. location.reload();
  184. e.preventDefault();
  185. });
  186. $("#btnSubmit").click(function(e)
  187. {
  188. ShowDialog(false);
  189. location.reload();
  190. e.preventDefault();
  191. });
  192. $("#shuffle div").hover(function() {
  193. $(this).css('cursor', 'pointer');
  194. }, function() {
  195. $(this).css('cursor', 'auto');
  196. });
  197. $('.cell').click(function(e)
  198. {
  199. function get_random_color() {
  200. var letters = '0123456789ABCDEF'.split('');
  201. var color = '#';
  202. for (var i = 0; i < 6; i++)
  203. {
  204. color += letters[Math.round(Math.random() * 15)];
  205. }
  206. return color;
  207. }
  208. var className = $(this).attr('class');
  209. if (className == "cell highlight")
  210. {
  211. $('#output').html(function(i, val) {
  212. return val * 1 + 1
  213. });
  214. }
  215. $('.cell').css("background-color", get_random_color());
  216. var rnd;
  217. function highlight()
  218. {
  219. var $divs = $('.cell').removeClass('highlight');
  220. rnd = Math.floor(Math.random() * $divs.length);
  221. $divs.eq(rnd).addClass('highlight');
  222. }
  223. highlight();
  224. });
  225. });
  226. function ShowDialog(modal)
  227. {
  228. $("#overlay").show();
  229. $("#dialog").fadeIn(300);
  230. if (modal)
  231. {
  232. $("#overlay").unbind("click");
  233. } else
  234. {
  235. $("#overlay").click(function(e)
  236. {
  237. HideDialog();
  238. });
  239. }
  240. }
  241. function HideDialog()
  242. {
  243. $("#overlay").hide();
  244. $("#dialog").fadeOut(300);
  245. }
  246. </script>
  247. </head>
  248. <body <form>
  249. <img src="Images/bulb_mind_brain_svg-256.png" alt="hi" style="width:256px;height:256px;">
  250. <br>
  251. <br>
  252. <div style="text-align:center;">
  253. <div id="scr">YOUR SCORE : </div>
  254. <div id="output">00</div>
  255. </div>
  256. <br>
  257. <br>
  258. <br>
  259. <input type="button" class="styled-button-2" id="btnShowSimple" value="START" />
  260. <input type="button" class="styled-button-2" id="btnShowModal" value="RESTART" />
  261. <br />
  262. <br />
  263. <div id="output"></div>
  264. <div id="overlay" class="web_dialog_overlay"></div>
  265. <div id="dialog" class="web_dialog">
  266. <table style="width: 100%; border: 0px;" cellpadding="3" cellspacing="0">
  267. <tr>
  268. <td class="web_dialog_title"></td>
  269. <td class="web_dialog_title align_right">
  270. <a href="#" id="btnClose">Close</a>
  271. </td>
  272. </tr>
  273. <td> </td>
  274. <td> </td>
  275. <tr>
  276. <td style="text-align: center" ;>
  277. Time Left <b id="countdown"></b> seconds
  278. <img src="Images/Alarm.png" alt="Timer" style="width:48px;height:48px;">
  279. </td>
  280. </tr>
  281. <tr>
  282. <td> </td>
  283. </tr>
  284. <tr>
  285. <td colspan="2" style="padding-left: 15px;">
  286. </td>
  287. </tr>
  288. <tr>
  289. <td> </td>
  290. <td> </td>
  291. </tr>
  292. <tr>
  293. <td colspan="2" style="padding-left: 15px;">
  294. <div id="shuffle">
  295. <div class="cell"></div>
  296. <div class="cell"></div>
  297. <div class="cell"></div>
  298. <div class="cell"></div>
  299. <div class="cell"></div>
  300. <div class="cell"></div>
  301. <div class="cell"></div>
  302. <div class="cell"></div>
  303. <div class="cell"></div>
  304. <div class="cell"></div>
  305. <div class="cell"></div>
  306. <div class="cell"></div>
  307. <div class="cell"></div>
  308. <div class="cell"></div>
  309. <div class="cell"></div>
  310. <div class="cell"></div>
  311. <div class="cell"></div>
  312. <div class="cell"></div>
  313. <div class="cell"></div>
  314. <div class="cell"></div>
  315. <div class="cell"></div>
  316. <div class="cell"></div>
  317. <div class="cell"></div>
  318. <div class="cell"></div>
  319. <div class="cell"></div>
  320. <div class="cell"></div>
  321. <div class="cell"></div>
  322. <div class="cell"></div>
  323. <div class="cell"></div>
  324. <div class="cell"></div>
  325. <div class="cell"></div>
  326. <div class="cell"></div>
  327. <div class="cell"></div>
  328. <div class="cell"></div>
  329. <div class="cell"></div>
  330. <div class="cell"></div>
  331. <div class="cell"></div>
  332. <div class="cell"></div>
  333. <div class="cell"></div>
  334. <div class="cell"></div>
  335. <div class="cell"></div>
  336. <div class="cell"></div>
  337. <div class="cell"></div>
  338. <div class="cell"></div>
  339. <div class="cell"></div>
  340. <div class="cell"></div>
  341. <div class="cell"></div>
  342. <div class="cell"></div>
  343. <div class="cell"></div>
  344. <div class="cell"></div>
  345. <div class="cell"></div>
  346. <div class="cell"></div>
  347. <div class="cell"></div>
  348. <div class="cell"></div>
  349. <div class="cell"></div>
  350. <div class="cell"></div>
  351. <div class="cell"></div>
  352. <div class="cell"></div>
  353. <div class="cell"></div>
  354. <div class="cell"></div>
  355. <div class="cell"></div>
  356. <div class="cell"></div>
  357. <div class="cell"></div>
  358. <div class="cell"></div>
  359. <div class="cell"></div>
  360. <div class="cell"></div>
  361. <div class="cell"></div>
  362. <div class="cell"></div>
  363. <div class="cell"></div>
  364. <div class="cell"></div>
  365. <div class="cell"></div>
  366. <div class="cell"></div>
  367. <div class="cell"></div>
  368. <div class="cell"></div>
  369. <div class="cell"></div>
  370. <div class="cell"></div>
  371. <div class="cell"></div>
  372. <div class="cell"></div>
  373. <div class="cell"></div>
  374. <div class="cell"></div>
  375. <div class="cell"></div>
  376. <div class="cell"></div>
  377. <div class="cell"></div>
  378. <div class="cell"></div>
  379. <div class="cell"></div>
  380. <div class="cell"></div>
  381. <div class="cell"></div>
  382. <div class="cell"></div>
  383. <div class="cell"></div>
  384. <div class="cell"></div>
  385. <div class="cell"></div>
  386. <div class="cell"></div>
  387. <div class="cell"></div>
  388. <div class="cell"></div>
  389. <div class="cell"></div>
  390. <div class="cell"></div>
  391. <div class="cell"></div>
  392. <div class="cell"></div>
  393. <div class="cell"></div>
  394. <div class="cell"></div>
  395. </div>
  396. </td>
  397. </tr>
  398. <tr>
  399. <td> </td>
  400. <td> </td>
  401. </tr>
  402. <tr>
  403. <td colspan="2" style="text-align: center;">
  404. <input id="btnSubmit" class="styled-button-3" type="button" value="Exit" />
  405. </td>
  406. </tr>
  407. </table>
  408. </div>
  409. </form>
  410. </body </html>
Output

This simple puzzle game will test the quality of your color vision. You need to identify one tile which is not the same color with the other tiles.

1. Open the HTML file in your web browser.

Game Main Page
Figure 2: Mind Tickling Riddles Game Main Page

2. Start the game

3. You need to identify one tile which is not the same color with the other tiles.

Mind Tickling Riddles
Figure 3: Mind Tickling Riddles Color Tiles

Riddles Color Tiles
Figure 4: Mind Tickling Riddles Color Tiles

Tickling Riddles Color Tiles
Figure 5: Mind Tickling Riddles Color Tiles

Mind Tickling Riddles Color Tiles
Figure 6: Mind Tickling Riddles Color Tiles

Game over alert
Figure 7: Game over alert

Score board
Figure 8: Score board

Conclusion

I hope you liked this useful article. It will be useful for jQuery beginners and developers. Please provide your valuable feedback and suggestions.

Live demo

Game Link: Jsfiddle

References