Exercise:
Use the correct selector to hide all <p> elements.
Hint
Syntax hint: $("
element
")
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(){ $("selector").hide(); }); </script> </head> <body> <h2>This is a heading</h2> <p>This is a paragraph.</p> <p>This is another paragraph.</p> </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(){ $("p").hide(); }); </script> </head> <body> <h2>This is a heading</h2> <p>This is a paragraph.</p> <p>This is another paragraph.</p> </body> </html>
Correct Result:
Hide Answer
Privacy Policy