Skip to content

Commit d36fa3b

Browse files
author
abdul rafay
committed
assigment complete
1 parent a70f17b commit d36fa3b

3 files changed

Lines changed: 21 additions & 15 deletions

File tree

index.html

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,18 @@
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<title>DOM</title>
8+
<link rel="stylesheet" href="style.css">
89
</head>
910

1011
<body>
1112

12-
13-
14-
15-
1613
<p id="paragraph">
17-
Slow lorises are a group of several species of strepsirrhine primates which make up the genus Nycticebus.
14+
My name is abdul rafay this is my best assigne....
1815
<a href="javascript:void(0);" onclick="paragraph();">
1916
<em>Click for more</em>
2017
</a>
2118
</p>
2219

23-
24-
25-
26-
27-
28-
2920
<script src="index.js"></script>
3021
</body>
3122

index.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
1-
2-
31
var isExpanded = false;
42

53
function paragraph() {
6-
var shortpara = ' Slow lorises are a group of several species of strepsirrhine primates which make up the genus Nycticebus'
74

8-
var fullpara = 'Text chan'
5+
var shortpara = 'My name is abdul rafay this is my best assigne....' +
6+
' <a href="javascript:void(0);" onclick="paragraph();"><em>Click for more</em></a>';
7+
8+
var fullpara = 'assignemt in JavaScript <a href="javascript:void(0);" onclick="paragraph();"<em>Click for Less </em> </a>'
9+
910

11+
if (isExpanded === false) {
12+
document.getElementById("paragraph").innerHTML = fullpara
13+
isExpanded = true;
14+
} else {
15+
document.getElementById("paragraph").innerHTML = shortpara
16+
isExpanded = false
17+
}
1018
}
1119

1220

style.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#paragraph {
2+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
3+
font-weight: 700;
4+
background-color: aqua;
5+
text-align: center;
6+
7+
}

0 commit comments

Comments
 (0)