How to show button on div mouse hover

前端 未结 5 1464
暗喜
暗喜 2020-12-11 04:42

i want to show button on div hover. when i hover mouse on div then button show otherwise hide.

my button in divbutton div.

html

         


        
5条回答
  •  [愿得一人]
    2020-12-11 05:45

    Try this:

    $('.divbutton').mouseover(function(event)
    {
       $(this).find('button').show();
    });
    
    $('.divbutton').mouseout(function(event)
    {
       $(this).find('button').hide();
    });
    

提交回复
热议问题