:not 总是让我很头疼。我试图不重复添加加号。这是给我想要的元素的选择器:
#submenu li.current_page_ancestor.current_page_parent a:first
基本上我想说的是,如果该选择器前面还没有加号,请添加它。但是我在哪里放置 :not 和各种包含?我试过这个,但没有奏效:
$j('#submenu li.current_page_ancestor.current_page_parent a:first:not('contains("+")')).prepend("+ ");
非常感谢!(另外,如果有人可以推荐一种不使用 :not 并使用 ! 的方法,那将是壮观的!)