In your example code you are not asking for the parent of
a
.
$("#Panel ul li a").find("[value='art6']")
will look for an element
inside a
matching
[value='art6']
.
Find returns the element you were looking for (or 0 length jQuery wrapper if it can't find it) and as such when using
.parent()
on the result of
.find()
you are asking for the parent of
[value='art6']
instead, which is
not a
.
Not knowing how deep your element
[value='art6']
is inside
a
your best bet is to use:
$("#Panel ul li a").find("[value='art6']").closest('li').css("styles here");
However, if you wanted to look for an
a
element which itself has a value of
art6
then your selector is wrong to begin with and should be this:
$("#Panel ul li a[value='art6']").parent().css("styles here");
In the above scenario the
li
can be omitted as the direct parent to your selector is the
li
already.
As you have not posted your actual HTML markup it is not possible to know if your selector is wrong or your usage of
.parent()
but hopefully one of the examples above helps you in solving your issue.