Could this be ? function ofertaDetalle(idoferta){ //this is quite odd, but should work if( ofertaDetalle.$element )//if one was hilited ofertaDetalle.$element.removeClass('hilightOn');//revert it to normal
var selector = '#puestoAspira'+idoferta;//this gets you the selector to match that specific TD ofertaDetalle.$element = $(selector).addClass('hilightOn');//find the new TD, highlight it and save it into ofertaDetalle.$element }; Cheers. Ariel Flesler On Jan 9, 1:16 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi everyone, I need assistance with some "how-to". I'm new to jq, so > a little help would be much appreciated. > > I have a function that receives a value each time an <a href> is > clicked, for every click I get a different value, I want to use this > value a ID in the "td" of a table, such "td's" are already ID'ed with > the value I want, so I can later manipulate them, for things such as > to hilight or remove the element from the DOM, etc. > > This is a piece of the code: > > function ofertaDetalle(idoferta){ // idoferta is the variable > > varID = "puestoAspira"+idoferta //I wanted to concatenate some > text to the id > > $(#varID).addClass("hilightOn"); //since I don't know how to do > it, I was trying different things > > $("td:contains(varID)").toggle( > function () { > $("td:contains(varID)").addClass("hilightOn"); > }, > function () { > $("td:contains(varID)").removeClass("hilightOn"); > } > );