Problems with jquery selector
<p>I have a trouble with selecting element attributes with jquery here is my HTML:</p>

<pre><code>&lt;a class="myselector" rel="I need this value"&gt;&lt;/a&gt;

&lt;div class="someClass" id="someID"&gt;
...bunch of elements/content
&lt;input type="button" name="myInput" id="inputID" title="myInput Title" /&gt;
...bunch of elements/content
&lt;/div&gt;
</code></pre>

<p>...bunch of elements/content</p>

<p>Here I'm trying to get the rel value of myselector here is how I tried but its not working :</p>

<pre><code>$('#inputID').live('click',function(){
console.log($(this).closest('a.myselector').attr('rel'));
});
</code></pre>

<p>Also tried this since all is wrapped in wrapper div :</p>

<pre><code>$('#inputID').live('click',function(){
console.log($(this).parent('div.wrapper').find('a.myselector').attr('rel'));
});
</code></pre>

<p>I get <code>undefined</code> value in firebug in both cases, I use live because <code>div#someID</code> is loaded in the document its not there when page first loads. Any advice, how can I get my selector rel value?</p>

<p><strong>EDIT:</strong></p>

<p>However when I look for <code>('a.myselector')</code> without rel attribute, I alert <code>Object object</code> and get console.log something <code>[]</code></p>
