jquery hover().addClass() problem

后端 未结 4 800
南笙
南笙 2021-01-07 04:31

http://jsfiddle.net/aBaw6/2/

This demo does not add class when you hover a list item.

What am I doing wrong here?

$(\"li\").hover(
  function         


        
4条回答
  •  自闭症患者
    2021-01-07 04:49

    You Have Missed the quote '

       $("li").hover(
          function () {
            $(this).addClass('hover');
          },
          function () {
            $(this).removeClass("hover");
          }
        );
    

提交回复
热议问题