title: Using map function of jquery to alert the values of checkbox
body: <p>HTML Code:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
  &lt;title&gt;JobSeeker Registration Page &lt;/title&gt;
   &lt;meta charset="utf-8"&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
    &lt;link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"&gt;
    &lt;script type="text/javascript" src="../jquery-1.11.3.min.js"&gt;&lt;/script&gt;
    &lt;script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"&gt;&lt;/script&gt;
  
  
     &lt;script type="text/javascript" src="try.js"&gt;&lt;/script&gt;
   &lt;/head&gt;
   &lt;body&gt;
   &lt;div&gt;
   &lt;form&gt;
   &lt;input type="checkbox" name="cb" value="First" /&gt; First
  &lt;input type="submit" value="Submit" id="sm" /&gt; Submit
  &lt;/form&gt;
  &lt;/div&gt;
   &lt;/body&gt;
  
   &lt;/html&gt;
  </code></pre>
  
  <p>Jquery Code:</p>
  
  <pre><code>$(document).ready(function(){
      //alert("hello");
  
   $("#sm").click(function(event){
      event.preventDefault();
      var searchIDs =
      $(".cb:checked").map(function(){
        return $(this).attr('value');;
      }).get();
      alert(searchIDs.join(','));
      });
  
  });
  </code></pre>
  
  <p>I am trying to alert the values of the checkbox on to the browser. But no data is coming. Could anybody please tell me what is the problem with the above code.</p>