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