When I run this function:
onUnCheck: function(el) {
var thenames = "icon-"+el.find("label:first").text().replace(/ /g,'').toLowerCase();
alert(thenames);
$("'."+thenames+"'").hide("fast");
}
I am generating a string. I see in alert () that this is indeed the correct line. Example:
icon-jira
But when I pass the string as a jQuery selector, it does not work.
I know that the logic of the function sounds because the insert as a result of my warning () makes it work.
Why doesn't jQuery accept my string?
source
share