title: Not able to get the value of Radio Button
body: <pre><code>&lt;input type="radio" name="animal" id="cat" value="Cat" /&gt;
                  &lt;label for="cat"&gt;Cat&lt;/label&gt;
  
              &lt;input type="radio" name="animal" id="radio-choice-2" value="choice-2"/&gt;
              &lt;label for="radio-choice-2"&gt;Dog&lt;/label&gt;
  
              &lt;input type="radio" name="animal" id="radio-choice-3" value="choice-3"  /&gt;
              &lt;label for="radio-choice-3"&gt;Hamster&lt;/label&gt;
  
              &lt;input type="radio" name="animal" id="radio-choice-4" value="choice-4"  /&gt;
              &lt;label for="radio-choice-4"&gt;Lizard&lt;/label&gt;
              &lt;input type="button" value="Get Radio Button Value" onclick="getValue();"
  </code></pre>
  
  <p>I want to get the value of selected Radio Button on click of button I had written the code</p>
  
  <pre><code>function getValue () {
      alert("Value is :"+$('input[name=animal]:checked').val());  
      }
  </code></pre>
  
  <p>But its not working and getting Undefined</p>
  
  <p><strong>Update:</strong> </p>
  
  <p>I have used js of Jquery and jquerymobile 
  for jquery its for fine but as i am using it for mobile app so i need both  the js library so in second case it didnot work.</p>
  
  <pre><code>&lt;link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0-rc.1/jquery.mobile-1.1.0-rc.1.min.css" /&gt;
      &lt;script src="http://code.jquery.com/jquery-1.7.1.min.js"&gt;&lt;/script&gt;
      &lt;script src="http://code.jquery.com/mobile/1.1.0-rc.1/jquery.mobile-1.1.0-rc.1.min.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <h2><strong>[Solved]</strong></h2>