title: How to toggle image in html and also store 0 or 1 in flag variable?
body: <p>I want a star icon image will be displayed at a time,contains two star icons, one is blank and another is yellow in colour and will be swapped as clicked or tap for touch screen devices.</p>
  
  <p>And one more thing,I need is while swapping,I want to store values as 0 or 1 in flag variable.star1.jpg(blank/dull star) represent as 0 value.star2.jpg(yellow star) represents as 1.</p>
  
  <p>Real life example in google restaurant result,right side star button.
  <a href="http://gilsmethod.wpengine.netdna-cdn.com/wp-content/uploads/2010/11/google-hotpot-recommendations-android-maps.png" rel="nofollow">http://gilsmethod.wpengine.netdna-cdn.com/wp-content/uploads/2010/11/google-hotpot-recommendations-android-maps.png</a></p>
  
  <p>I want simple coding.</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;table&gt;
                  &lt;tbody&gt;
                      &lt;tr&gt;
                          &lt;td width="91%"&gt;Restaurant 1&lt;/td&gt;
                          &lt;td&gt;
                                  &lt;a href=""&gt;
                                      &lt;img border="0"
                                      src="star1.jpg"
                                      width="100%" height="100%" align="middle" &gt;
                                  &lt;/a&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;Restaurant 2&lt;/td&gt;
                          &lt;td&gt;
                                  &lt;a href=""&gt;
                                      &lt;img border="0"
                                      src="star1.jpg"
                                      width="100%" height="100%" align="middle" &gt;
                                  &lt;/a&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                  &lt;/tbody&gt;
              &lt;/table&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>