views:

16

answers:

0

I'm doing a table using the plugin livequery

function soroRow(numSoro){
    if(numSoro % 2 == 0) var cRow = 'even';
    else var cRow = 'odd';
    var content = ($('<tr>')
       .addClass(cRow)
       .attr('id', 'soro_'+numSoro)
       .append($('<td />').appendText(numSoro+''))
       .append($('<td />')
           .append($('<select>')
               .addClass('soro')
               .addClass('required')
               .attr('name', 'soroColetado')
               .attr('id'  , 'soroColetado_' + numSoro)
               .append($("<option> ----  </option>"))
               .append($("<option value='sim'> Sim  </option>"))
               .append($("<option value='nao'> N&atilde;o  </option>"))
               .append($("<option value='ignorado'> Ignorado  </option>"))
           )
       )
       .append($('<td />')
           .append($('<input>')
               .addClass('number')
               .attr('name', 'numeroSoro')
               .attr('disabled', 'disabled')
               .attr('id', 'numeroSoro_'+numSoro)
           )
       )
   );
   return content;
}

If I put in

$(document).ready( function(){

this lines:

console.log($('table'));
console.log($('#soroColetado_1'));

The first line give this following output:

[table.datatable]

and when I click, the FireBug show me the perfect HTML code (generated by livequery), including the element that have id "soroColetado_1"

But my second line return

[]

Which is weird, because it element seems to exist because of the first console.log line.

My question is: How can I get this element?