Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jsPractice
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sumaiyya Burney
jsPractice
Commits
d54e5938
Commit
d54e5938
authored
Apr 09, 2021
by
Sumaiyya Burney
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial commit
parents
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
0 deletions
+47
-0
firstPractice.html
firstPractice.html
+21
-0
jsPract.js
jsPract.js
+26
-0
No files found.
firstPractice.html
0 → 100644
View file @
d54e5938
<html>
<head>
<title>
Basic HTML !!!
</title>
<script
type=
"text/javascript"
src=
"jsPract.js"
></script>
</head>
<body>
<h1>
Hello, World!!
</h1>
<script
type=
"text/javascript"
>
funct
()
</script>
<form>
<input
id=
"textIn"
>
<button
id=
"submit"
onclick=
"writeUserIn()"
>
ok
</button>
</form>
<form>
<input
id=
"numIn"
type=
"number"
>
<button
id=
"numBut"
onclick=
"primeNums()"
>
Generate prime numbers
</button>
</form>
</body>
</html>
\ No newline at end of file
jsPract.js
0 → 100644
View file @
d54e5938
// Variables - Scopes DONE
// Functions DONE
// Operators DONE
// Conditional statements DONE
// Loops DONE
function
funct
(){
document
.
write
(
"pls write"
);
}
function
writeUserIn
(){
var
userIn
=
document
.
getElementById
(
"textIn"
).
value
;
alert
(
userIn
)
}
//global var
const
primes
=
[
2
,
3
,
5
,
7
,
11
,
13
,
17
,
19
,
23
,
29
,
31
,
37
,
41
,
43
,
47
,
53
,
59
,
61
,
67
,
71
,
73
,
79
,
83
,
89
,
97
];
function
primeNums
(){
var
numIn
=
document
.
getElementById
(
"numIn"
).
value
;
for
(
i
=
0
;
i
<
(
Math
.
min
(
numIn
,
100
));
i
++
){
if
(
primes
.
includes
(
i
)){
document
.
write
(
i
+
'
\
n'
);
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment