jquery un-hover

前端 未结 4 1405
花落未央
花落未央 2021-02-07 21:08

I have this script to cause a background color on a paragraph on hover of link within the paragraph. What I don\'t know how to do is cause it to return to the original backgroun

4条回答
  •  长情又很酷
    2021-02-07 21:57

    JQuery

    $(".box a").hover(function(){
        $(this).parent().css('background-color', '#fff200');
     }, function() {
         $(this).parent().css('background-color', '#ffffff');
     });
    

    See fiddle.

提交回复
热议问题