Skip to content

Commit 7b4d0d9

Browse files
author
abdul rafay
committed
JavaScript_small_assigment_Click_Text show and hide
0 parents  commit 7b4d0d9

3 files changed

Lines changed: 54 additions & 0 deletions

File tree

index.html

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>DOM</title>
8+
</head>
9+
10+
<body>
11+
12+
13+
14+
<p id="expent">this is a samall paragraph
15+
<a href="#" onclick="showpara()"><em>Click for more information</em></a>
16+
</p>
17+
18+
19+
<p id="paragraph">
20+
Slow lorises are a group of several species of strepsirrhine primates which make up the genus Nycticebus.
21+
<a href="javascript:void(0);" onclick="paragraph();">
22+
<em>Click for more</em>
23+
</a>
24+
</p>
25+
26+
27+
28+
29+
30+
31+
32+
<script src="index.js"></script>
33+
</body>
34+
35+
</html>

index.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
function showpara() {
2+
var fullpara = '<h1>Experience projects involving web development, data analysis, and machine learning. My experience includes internships at tech companies where I contributed to developing user-friendly applications and optimizing algorithms for better performance. I am proficient in various programming languages such as JavaScript, Python, and Java, and have a strong understanding of software development principles.</h1>';
3+
var smallpara = document.getElementById("expent");
4+
smallpara.innerText = fullpara;
5+
console.log("fullpara shown", fullpara);
6+
console.log("smallpara shown", smallpara);
7+
}
8+
9+
10+
var isExpanded = false;
11+
12+
function paragraph() {
13+
var shortpara = ' Slow lorises are a group of several species of strepsirrhine primates which make up the genus Nycticebus'
14+
15+
var fullpara = 'Text chan'
16+
17+
}
18+
19+

style.css

Whitespace-only changes.

0 commit comments

Comments
 (0)