I have checked a few answers on SO and I think my syntax is correct, but something is not working correctly.
I am trying to create an array of jquery selectors mixed with variables and store them in a not() function.
I have this fiddle to demonstrate.
The second line of the function is not working:
var trigger = $('mainNav li:eq(0) a');
var headerLinks = $('#header a').not('.control a', + trigger);
My first thought was that #header a has more precedence over .control a in css terms. But changing classes and ID's doesn't seem to work.
Similarly I have a simpler var further in my code:
var content = $('.content');
var added = $('.extraList', + content);
In the console added is only returning the extraList selector.
1 Does the not function work differently to other jquery selectors? I was hoping to see the array of all the elements selected and/or filtered in the console
2 Is there a way to store the vars and selectors in a standard array and call that? I don't know how this would look exactly as jquery would need to interpret it, but something like this:
var arr = ['.control a', headerLinks, content, '.post'];
I realise that is mixing types but I am not sure how to pass both jquery variables and selectors into the same array, if it is possible.