Why the paragraph is not hiding? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why the paragraph is not hiding?

<p>I am a paragraph </p> $("p").click(function(){$("this").hide("slow");});

14th Nov 2016, 11:10 AM
Sainze Hang
Sainze Hang - avatar
3 Answers
+ 2
try this code: $("p").click(function(){$(this).hide("slow");}); don't use "this", but this without quotation mark
14th Nov 2016, 11:43 AM
Maurizio Urso
Maurizio Urso - avatar
+ 2
$(document).ready(function(){ $("p").click(function(){ $(this).hide("slow"); }); }); I think on playground it does not work independent you have to use .ready method
14th Nov 2016, 11:55 AM
Aditya kumar pandey
Aditya kumar pandey - avatar
+ 1
Did you add this line in your head tag <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> </script>
14th Nov 2016, 11:39 AM
Aditya kumar pandey
Aditya kumar pandey - avatar