I have Attribute Filter like this one: $(’input[name="email"]‘);
I want to create a function with a parameter, which would contain the name of the attribute, something like this:
function test(id_new){ var var_name = $("input[name='"+id_new+"']:checked").val(); alert(var_name); }
But this code is not working. How can I solve this?
Which version of jQuery are you using? I’ll assume 1.3.
Try removing the single quotes in the attribute selector: