How to Show Button on Hover Div Element in jQuery

Last Updated on May 6, 2021 by Roshan Parihar

In this tutorial, learn how to show button on hover div element using jQuery. The short answer is: use the jQuery show() and hide() to show/hide button on mouseover.

You can also use the jQuery toggle() to toggle the button on hover div element in jQuery. Let’s find out with the examples given below.

How to Show Button on Hover Div Element in jQuery

To show/hide the button on hover, you have to first hide the button using the CSS property display: none. After that, you need to use the jQuery script that uses the show() and hide() as given below:

Test it Live

The above example shows the script to use that you can test live using the ‘Test it Live’ button given above.

How to Toggle Button When Mouseover Div Element Using jQuery

In addition to the above example, you can also use the jQuery toggle() function to toggle the button on div hover. It requires first to hide the button using the CSS display: none property. After that, you need to use the jQuery script that uses the toggle() as given below:

Test it Live

The above example shows the lesser script as compared to the previous example. However, both the method requires a little CSS display: none to hide the <div> element.

You May Also Like to Read

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.