Exercise:
Use a jQuery method to fade out the <div> element.
Hint
Syntax hint: $("
element
").
method
();
Edit This Code:
See Result »
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script> <script> $(document).ready(function(){ // add code here }); </script> </head> <body> <div style="width:80px;height:80px;background-color:red;"></div> </body> </html>
Result:
Show Answer
Correct Code:
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script> <script> $(document).ready(function(){ $("div").fadeOut(); }); </script> </head> <body> <div style="width:80px;height:80px;background-color:red;"></div> </body> </html>
Correct Result:
Hide Answer
Privacy Policy