jQuery – how can I find the element with a certain id?

If you’re trying to find an element by id, you don’t need to search the table only – it should be unique on the page, and so you should be able to use:

var verificaHorario = $('#' + horaInicial);

If you need to search only in the table for whatever reason, you can use:

var verificaHorario = $("#tbIntervalos").find("td#" + horaInicial)

Leave a Comment