Get element jquery

Hi

i have html like below. When the anchor tag is hovered i want to change the th background.
How can i target the th?

(There are several rows so i need to use $this rather than just using the id )

i tried $(this).prev("th") but no joy

 <th colspan="3" width="100%" id="course-title">
  <span><a id="title" href=""><?=$title?></a></span>
</th>
coolispaulAsked:
Who is Participating?
 
Michel PlungjanConnect With a Mentor IT ExpertCommented:
$(this).parent().parent().css("background-color","red");
0
 
leakim971PluritechnicianCommented:
$(this).closest("th").css("background-color","red");

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.