title: how to show a text when a button is clicked(button is surrounded by <span></span> tag)
body: <p>I'm using codeigniter and in my project i have a form where i have to rate a product and i have add star buttons like below</p>
  
  <pre><code>&lt;h1&gt;
      &lt;div class="rating" style="width:200px;float:left;padding-left:1px"&gt;
          &lt;span id="span1" onclick="myFunction()"&gt;☆&lt;/span&gt; 
          &lt;span id="span2" onclick="myFunction()"&gt;☆&lt;/span&gt; 
          &lt;span id="span3" onclick="myFunction()"&gt;☆&lt;/span&gt; 
          &lt;span id="span4" onclick="myFunction()"&gt;☆&lt;/span&gt;
          &lt;span id="span5" onclick="myFunction()"&gt;☆&lt;/span&gt;
      &lt;/div&gt;
  &lt;/h1&gt;
  &lt;p id="rateText"&gt;&lt;/p&gt;
  </code></pre>
  
  <p>what i needed to know is when i clicked 1st button(id =span1) i need to show text "Terrible",when 2nd button is clicked i need to show "Unsatisfied" and when 3rd button is clicked "satisfied" in the place where p tag is . so how can i achieve that please help me ?</p>