문제

I have a jsFiddle set up for this: http://jsfiddle.net/eventide/TAmam/

I'm trying to apply the "addNote" class to specific items in a navigation menu. The class adds an image, but I don't know how to add an image to stuff in jsFiddle (please let me know if you can - and how to do it!).

Anyway, I only want to apply the class to "li" tags with local links (to pages within the site domain), so, using jQuery, I need to select all "li" elements in #nav that have an "a" tag, but do not have "http" in the href attribute.

I'd appreciate it if anyone can help me out with selecting only those specific "li" elements in the menu. Thanks!

도움이 되었습니까?

해결책

I think this is what you want:

$("#nav li:has(a:not([href^='http://']))")
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top