Sorry about my grammar, English isn't my lang. I am trying to write code like that: var expr=true,selector='div'; $(selector) (expr ? .next() : .before() ). show();
But it's not JS syntax. So how can I do it? I know,that I can do it like that: if (expr) $(selector)..before(),show() else $(selector).next().show() But I am trying to find a solution, that return a jQuery object. Thank you.