why does this work with an element?
<script> $(document).ready(function(){ $("p").click(function(){ $(this).hide(); }); }); </script> </head> <body> <p>If you click on me, I will disappear.</p> <p>Click me away!</p> <p>Click me too!</p>
If you click on each, it will disappear.
But if I encode it with a hang ..
<script> $(document).ready(function(){ $("p").hover(function(){ $(this).hide(); }); }); </script> </head> <body> <p>If you click on me, I will disappear.</p> <p>Click me away!</p> <p>Click me too!</p>
They all disappear together. What's the difference?
source share