jQuery makes coding simple. jQuery is supported by all major browsers including Internet explorer. We can connect jQuery with backend code to make code simple.
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<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>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("p").click(function(){
$(this).hide();
});
});
</script>
</head>
<body>
<p>Click Here...</p>
</body>
</html>
Result
Click Here...
When you click on "Click here..." text you can see the text disappears. This effect is done by jQuery hide() function. If you want to hide and HTML element you can use hide() or toggle() method.
<script src="effect.js"></script>
Share this E-Learning Website on social media platforms with your friends and followers
Share Now