How to apply custom CSS on element on hover-in and hover-out in jquery?

Total Post:1

Points:7
JQuery  CSS 
C#
 343  View(s)
Ratings:
Rate this:

Hi,

I want to apply custom CSS on HTML element on mouse hover-in and hover-out from jquery.

<span>

     <input title="Click to submit" name="" onclick="return on_button_click(this);" type="submit" value="" class="btn-Submit">
 </span>

Please give me some idea to achieve this task.

  1. Post:44

    Points:310
    Re: How to apply custom CSS on element on hover-in and hover-out in jquery?

    Hi Filip,

    You can achieve your task by this way.

    Write following line code in jquery:

     $(".btn-fav").hover(function () {
                $('.btn-fav').css("background-color", "red");
            }, function () {
                $('.btn-fav').css("background-color", "green");
            });

    I hope it's informative!!!

      Modified On Mar-18-2018 11:13:43 PM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!