Does anyone know a work around or how to add a value to :contains. Here is my code I am working with
$('.printer_element > h2').each(function (i) { if($(this).nextAll().size() > 0) { //do nothing } else { //Here we hide the whole div from the browser. We use display none so the divs below the hidden div can move up into the next higher position $(this).parent().css({ display:"none"}); //next we need to hid the checkbox and link in the page layout for the hidden printer_element //first we asign the name of the hidden printer_element to a variable var hidden_div = $(this).text(); //Now we select the link of the corresponding text and remove it $('ul#list_container a:contains(hidden_div)').remove(); } }); I would like to use hidden_div variable inside of they :contains() when searching through my links I would like to do this dynamicaly but it looks like I might have to write redundant code to check all of my links. Thanks for the help.