Find a element with particular name attribute or id in HTML with JQuery
<p>I have a table with couple of columns, one of which is a link, on clicking it, I am calling JQuery click event. On click I want to get the value of a another column, which is a sibling of this column(td). how can i get it. </p>

<pre><code>HTML
&lt;table class="table table-bordered table-hover"&gt;
                                        &lt;thead&gt;
                                            &lt;th&gt;RID&lt;/th&gt;
                                            &lt;th&gt;Mobile Number&lt;/th&gt;
                                            &lt;th&gt;Outlet Name&lt;/th&gt;
                                            &lt;th&gt;Place&lt;/th&gt;
                                            &lt;th&gt;Email&lt;/th&gt;
                                            &lt;th&gt;Balance&lt;/th&gt;
                                            &lt;th&gt;Stock&lt;/th&gt;
                                            &lt;th&gt;Password&lt;/th&gt;
                                        &lt;/thead&gt;
                                        &lt;tr&gt;
                                            &lt;td data-name="rid"&gt;5111879&lt;/td&gt;
                                            &lt;td data-name="mobile"&gt;9066587654&lt;/td&gt;
                                            &lt;td data-name="outlet"&gt;Rachels&lt;/td&gt;
                                            &lt;td&gt;Indhiranagar, BL&lt;/td&gt;
                                            &lt;td&gt;rach@yahoo.com&lt;/td&gt;
                                            &lt;td&gt;&lt;i class="fa fa-inr"&gt;&lt;/i&gt;378665&lt;/td&gt;
                                            &lt;td&gt;&lt;a href="#" id="retailer_stock"&gt;TRANSFER&lt;/a&gt;&lt;/td&gt;
                                            &lt;td&gt;&lt;a href="#" id="retailer_reset"&gt;RESET&lt;/a&gt;&lt;/td&gt;
                                        &lt;/tr&gt;                                                                                                                           
                                    &lt;/table&gt;
</code></pre>

<p>on clicking the id=retailer_stock, a modal pops up and should have the value of data-name='rid'. How should i do it.</p>

<pre><code>Javascript
 $('#retailer_stock').click( function(event){
                    console.log($(this));
                    console.log($(event.target).closest('tr').children("[id = 'rid']"));
                    console.log($(this).closest('tr').children("[id = 'rid']"));
                    console.log($(event.target).closest('tr').find("[id = 'rid']"));
                    console.log($(event.target).siblings("[id = 'rid']"));
                    console.log($(this).closest("[id = 'rid']"));
                })
</code></pre>

<p>of these code lines, last two is not working, its not fetching me a result, can any of you explain why?</p>

<p>-thanks</p>