-
Notifications
You must be signed in to change notification settings - Fork 0
/
Fifth.html
31 lines (28 loc) · 1.18 KB
/
Fifth.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<html>
<head></head>
<body>
<div class ="article">
<img src="" height="200" width="200" alt="no img"/>
<h3>Article 1</h3>
<a href="#" class="readmore">Read more</a>
<p class = "description">This is article 1 description</p>
</div>
<div class ="article">
<img src="" height="200" width="200" alt="no img"/>
<h3>Article 2</h3>
<a href="#" class="readmore">Read more</a>
<p class = "description">This is article 2 description</p>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
var jQ = $.noConflict();
jQ(document).ready(function(){
jQ('.description').hide();// This hides the description(paragraph).
jQ('.readmore').click(function(e){
e.preventDefault();// This prevents the default function of readmore(anchor tag).
jQ(this).next().toggle(2000);// This toggles the next sibling of readmore(anchor tag).
});
});
</script>
</body>
</html>