[jQuery] How to Select element with class, but EXCLUDE its children?
I am manipulating a style on elements with class="House" or "Senate."
Unfortunately, it sets the style for every child underneath.
The tree is like this:
AL
House of Representatives
Member
Member
Member
Senate
Member
Member
Member
House has class="House." Senate has class="Senate." This is just the
label next to a checkbox that either says "House of Representatives"
or "Senate." I am using that label for a mouseover function, where
the label turns blue and is italicized for clicking.
Beneath this are all the Representatives or Senators, as children of
the previous element with class="House" or "Senate."
So, now, when I mouse over any of the children, they italicize as
well.
This occurs due to my command that says $(".House,.Senate").mouseover
(function().....
I need something to control only the top level, e.g. $
(".House,.Senate"(but not their children)....
Does anyone know the way to do this?