title: jquery get the text inside <li>
body: <p>I have this div</p>
  
  <pre><code>&lt;div class="RestauranstSection"&gt;
      &lt;label&gt;
          Restaurant:
      &lt;/label&gt;
      &lt;input type="text"/&gt;
      &lt;input type="button" value="Search"/&gt;
      &lt;ul&gt;
          &lt;?php while ($row = $restaurants-&gt;fetch()) {
              ?&gt;
              &lt;li id="&lt;?php echo $row['ID']; ?&gt;"&gt;
                  &lt;?php echo $row['name']; ?&gt;
              &lt;/li&gt;
          &lt;?php } ?&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I want when press on any <code>li</code> elements to alert its text, </p>
  
  <pre><code>$(".RestauranstSection").on('click','li',function (){});
  </code></pre>
  
  <p>how please?</p>