[jQuery] invoking an element dinamically
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");
}
);