check attribute is not undefined jQuery in <tr>
<p>I want to retrieve attribute values of all rows present in my table.and i some how done that but the starting &amp; ending values comes as "undefined".</p>

<p>how to apply validation on that.i tried some code but doesnt seem to be work.</p>

<pre><code>function currentTicketStatus() {
    var ids;
    $('tbody tr').each(function() {
        ids += ((ids == '' &amp;&amp; ids !== 'undefined') ? '' : '|') + $(this).attr('title');
    });
    alert(ids);
}
</code></pre>
