How To Pass id of an element on click event in Jquery
<p>I have a table with number of rows and I am using with click to show hidden rows. In each hidden rows I have a div with name content. That in this div I am using ajax to load second page. Actually when I click to Show button the second page will be appear in the div with classname content. My question :- is there a way to passing id of each row (the id of each row is in input hidden with name id) to the function on click event then use of that passed id in href to send to second page ?
Here is my Snippet :-</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>$(function() {
  $(".show").on("click", function(e) {
     var id = $(this).find(':hidden').val();
    e.preventDefault();
    $(this).closest("tr").next().find(".content").slideToggle();
   $(".content").load("/secondpage.htm?id="+id+"");
    alert(id)
  });
});</code></pre>
<pre class="snippet-code-css lang-css prettyprint-override"><code>.subRow {
  padding:0;
  background-color: #CFCFCF;

}
.content {
  background-color: #CFCFCF;
  display:none;
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;&lt;/script&gt;
&lt;table style="width:50%" border="1"&gt;
&lt;tr&gt;
&lt;td&gt;title&lt;/td&gt;
&lt;td&gt;title&lt;/td&gt;
&lt;td&gt;title&lt;/td&gt;
&lt;td&gt;&lt;a href="#" class="show"&gt;&lt;input type="hidden" val="123" name="id"/&gt;Show &lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr id="tr_2_1_0" class="subRow"&gt;
&lt;td colspan="6"&gt;&lt;div class="contentdiv"&gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
  &lt;tr&gt;
&lt;td&gt;title&lt;/td&gt;
&lt;td&gt;title&lt;/td&gt;
&lt;td&gt;title&lt;/td&gt;
&lt;td&gt;&lt;a href="#" class="show"&gt;&lt;input type="hidden" val="123" name="id"/&gt;Show &lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr id="tr_2_1_0" class="subRow"&gt;
&lt;td colspan="6"&gt;&lt;div class="contentdiv"&gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;/table&gt;</code></pre>
</div>
</div>
</p>

<p>Thanks</p>