Run
Reset
Chrome
Cobalt
Monokai
Dreamweaver
Vibrant Ink
<!DOCTYPE html> <html lang="en"> <head> <title>Learning jQuery</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> </head> <body> <button>Click Me!</button> <div></div> </body> </html>
.active{ color: white; background-color: #A9A9A9; }
$(document).ready(function(){ $("button").mouseenter(function(){ $(this).addClass("active"); $('div').text('active" class is added.'); }); });