I have this selector:
$('.kleo-main-header .nav > li a[href=#undefined]')
Syntax error, unrecognized expression: .kleo-main-header .nav > li a[href=#undefined]
You'll have to quote the attributes value when it contains special characters that are otherwise used in a selector, like the hash, which is also used for ID's.
jQuery uses a regex that searches for periods, hashes and such things in selectors, to figure out if it should search for an ID, class, or whatever.
$('.kleo-main-header .nav > li a[href="#undefined"]')
Note that you're matching an element that looks like
<a href="#undefined">anchor</a> ?