How to get parent id by chidren data in jQuery?
<p>I have blow HTML, I want to write a function that could get id of the anchor tag by its child record and the record index. It should looks like this:</p>

<pre><code>getLinkId("100", 0)=300001
getLinkId("RD", 1)=300001
getLinkId("PD", 1)=300002
getLinkId("902", 2)=300002
</code></pre>

<p>I think jQuery might help to implement, but I am not quite familiar with it. Could anyone help me?</p>

<pre><code>&lt;ul id="listview_Sample"&gt;
    &lt;li role="option"&gt;
    &lt;div class="ui-btn-inner ui-li"&gt;
    &lt;div class="ui-btn-text"&gt;&lt;a href="" class="listviewLines" id="300001"&gt;
    &lt;div class="lv_lines" id="300001"&gt;
    &lt;div class="lv_line"&gt;
    &lt;div class="lv_line_field"&gt;100&lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="lv_line"&gt;
    &lt;div class="lv_line_field"&gt;RD&lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="lv_line"&gt;
    &lt;div class="lv_line_field"&gt;501&lt;/div&gt;
    &lt;/div&gt;
    &lt;/div&gt;
    &lt;/a&gt;&lt;/div&gt;
    &lt;/li&gt;
    &lt;li role="option"&gt;
    &lt;div class="ui-btn-inner ui-li"&gt;
    &lt;div class="ui-btn-text"&gt;&lt;a href="" class="listviewLines" id="300002"&gt;
    &lt;div class="lv_lines" id="300002"&gt;
    &lt;div class="lv_line"&gt;
    &lt;div class="lv_line_field"&gt;200&lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="lv_line"&gt;
    &lt;div class="lv_line_field"&gt;PD&lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="lv_line"&gt;
    &lt;div class="lv_line_field"&gt;902&lt;/div&gt;
    &lt;/div&gt;
    &lt;/div&gt;
    &lt;/a&gt;&lt;/div&gt;
    &lt;span class="ui-icon ui-icon-arrow-r"&gt;&lt;/span&gt;&lt;/div&gt;
    &lt;/li&gt;
</code></pre>

<p></p>
