[Vuejs]-How can I make a required field turn red when a disabled button is hovered on?

0👍

Maybe you only need to use CSS for that:

<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Test</title>

        <style>
            h3{
                color: blue;
            }
            button:disable:hover ~ h3{
                color: red;
            }
        </style>
    </head>
    <body>
        <button disabled>
            disabled
        </button>

        <h3>Test</h3>
    </body>
</html>

The ~ symbol use to specify where the element h3 are. Here is the reference to that: How to affect other elements when one element is hovered.

Leave a comment