This is my code where am facing issue to add styles:
<div class="panel">
<a href = "link">
<img src="abc.jpg">
<h5>Description text</h5>
</a>
</div>
Requirement:
- When hover on the image then H5 text-color can changed in blue color.
- When hover on H5 text then the text-color can changed in red color.
Please welcome your fixes either in JavaScript or jQuery or CSS
My try is:
$(".panel a").hover(
function() { $("h5").css("color","red"); } );
$(".panel a").hover(
function() { $("img").css("color","blue"); } );