I need to highlight the row on click of anchor link.
<apex:repeat value="{!Requests}" var="request">
<tr>
<td><a onclick="sendRequestId('{!request.Id}');"> {!request.Subject} </a></td>
<td>{!request.Type}</td>
<td>{!request.Location__r.Name}</td>
<td>
<apex:outputText value="{0,date,MM/dd/yyyy}" >
<apex:param value="{!request.CreatedDate}"/>
</apex:outputText>
</td>
</tr>
</apex:repeat>
Best Answer
One possible non-jQuery solution:
Your hyperlink likely needs an
href
attribute which I've added to the example. I've then added another function to perform the highlighting of the closest parenttr
element with a yellow background. Theonclick
function might need toreturn false;
depending on the behavior you're expecting from the click of the link.