title: jQuery Raty get number of stars
body: <p>I have a simple rating system with jQuery Raty Plugin <a href="http://wbotelhos.com/raty/" rel="nofollow">http://wbotelhos.com/raty/</a>. The user should be able to click on a star, type in a very short text and then click a button. The button has a onClick function: </p>
  
  <pre><code>&lt;a onclick="submitReview(eventID, stadt)" data-role="button" data-theme="b"&gt;Feedback abgeben&lt;/a&gt;
  </code></pre>
  
  <p>This want this function to call eventID, stadt AND the number of stars selected. How is it possible to pass the number of stars to that onClick function? This is my code:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
  &lt;title&gt;Single page template&lt;/title&gt;
  
  &lt;link rel="stylesheet" href="css/jquery.mobile-1.3.1.min.css" /&gt;
  &lt;link rel="stylesheet" href="css/tellthedj.css" /&gt;
  &lt;link rel="stylesheet" href="css/styles.css" /&gt;
  &lt;link href='http://fonts.googleapis.com/css?family=Titillium+Web:300,600' rel='stylesheet' type='text/css'&gt;
  &lt;script src="js/jquery-1.8.3.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/jquery.mobile-1.3.1.min.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;div data-role="page" id="menu"&gt; 
  &lt;script src="js/functions.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="js/jquery.raty.js"&gt;&lt;/script&gt;
  &lt;script&gt;
      $(document).delegate('#menu', 'pageshow', function () {
          $('#star').raty();
          stadt = GetURLParameter('stadt');
          document.getElementById('deinestadt').value = stadt; 
          id = GetURLParameter('id');
          getEventFromId(id); 
          getEventText(id);
          eventID = GetURLParameter('id');
  
          $("a.button").click(function(){
          //Lets say, the Stars are next element to the &lt;a&gt;
          var stars = $(this).next().find("input[name='score']").val();
          submitReview(eventID, stadt, stars);
  });
  
      });
  &lt;/script&gt;
  
  
  &lt;div data-role="panel" id="panel"&gt;
      &lt;input id="deinestadt" style="text-align:left;" type="search" name="stadt" value="" onfocus="if(this.value=='wo bist du?') this.value=''" id="stadt" value="" /&gt;
      &lt;br&gt;
      &lt;a class="menu_button" onclick="location='events.html?stadt='+stadt;" data-transition="slide" data-role="button"&gt;&lt;img src="img/icon-map-marker.png"&gt;&lt;span class="button_text"&gt;Events in der Nähe&lt;/span&gt;&lt;/a&gt;
      &lt;a class="menu_button" onclick="location='menu.html?stadt='+stadt+'&amp;id='+eventID;" data-transition="slide" data-role="button"&gt;&lt;img src="img/icon-house.png"&gt;&lt;span class="button_text"&gt;Event Übersicht&lt;/span&gt;&lt;/a&gt;
      &lt;br&gt;
      &lt;a class="menu_button" onclick="location='reviews.html?stadt='+stadt+'&amp;id='+eventID;" data-transition="slide" data-role="button"&gt;&lt;img src="img/icon-badge.png"&gt;&lt;span class="button_text"&gt;Bewertungen ansehen&lt;/span&gt;&lt;/a&gt;
      &lt;a class="menu_button" onclick="location='review.html?stadt='+stadt+'&amp;id='+eventID;" data-role="button"&gt;&lt;img src="img/icon-pencil.png"&gt;&lt;span class="button_text"&gt;Event Bewerten&lt;/span&gt;&lt;/a&gt;
      &lt;br&gt;
      &lt;a class="menu_button" onclick="location='photos.html?stadt='+stadt+'&amp;id='+eventID;" data-role="button"&gt;&lt;img src="img/icon-photos.png"&gt;&lt;span class="button_text"&gt;Fotos ansehen&lt;/span&gt;&lt;/a&gt;
      &lt;a class="menu_button" onclick="location='upload_photo.html?stadt='+stadt+'&amp;id='+eventID;" data-role="button"&gt;&lt;img src="img/icon-upload-photo.png"&gt;&lt;span class="button_text"&gt;Foto hochladen&lt;/span&gt;&lt;/a&gt;
      &lt;br&gt;
      &lt;a class="menu_button" onclick="location='music.html?stadt='+stadt+'&amp;id='+eventID;" data-role="button"&gt;&lt;img src="img/icon-note.png"&gt;&lt;span class="button_text"&gt;Musikwunsch&lt;/span&gt;&lt;/a&gt;
  
  &lt;/div&gt;&lt;!-- /panel --&gt;
  
    &lt;!-- header --&gt;
    &lt;div data-role="header" data-position="fixed" id="header"&gt;
      &lt;a href="#panel" data-role="button" data-icon="bars" data-iconpos="notext" data-inline="true"&gt;&lt;/a&gt;
      &lt;h1 id="headline"&gt;Event Bewerten&lt;/h1&gt;
    &lt;/div&gt;
    &lt;!-- /header --&gt; 
  
    &lt;!-- content --&gt;
    &lt;div data-role="content"&gt; 
      &lt;div id="review"&gt;
          &lt;h3&gt;wie gefällt es dir hier?&lt;/h3&gt;
          &lt;div id="star"&gt;&lt;/div&gt;&lt;br&gt;
          &lt;form&gt;
              &lt;label for="textarea-1"&gt;Schreib etwas über das Event:&lt;/label&gt;
              &lt;textarea cols="40" style="height:150px;" rows="10" name="textarea-1" id="textarea-1"&gt;&lt;/textarea&gt;
          &lt;/form&gt;
          &lt;a onclick="submitReview(eventID, stadt)" data-role="button" data-theme="b"&gt;Feedback abgeben&lt;/a&gt;
      &lt;/div&gt;  
    &lt;/div&gt;
    &lt;!-- /content --&gt; 
  
  &lt;div data-role="footer" data-position="fixed"&gt;      
  
  &lt;/div&gt;&lt;!-- /footer --&gt;
  
  &lt;/div&gt;
  &lt;!-- /page --&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>