Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
debounce
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
Muhammad Ameen
debounce
Commits
71e4de7d
Commit
71e4de7d
authored
Jun 01, 2022
by
Muhammad Ameen
💻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Debounce complete
parent
74af31a7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
10 deletions
+22
-10
app.js
app.js
+14
-9
inex.html
inex.html
+2
-1
style.css
style.css
+6
-0
No files found.
app.js
View file @
71e4de7d
let
searching
=
document
.
getElementById
(
"searching"
);
let
count
=
document
.
getElementById
(
"count"
);
let
input
=
document
.
getElementById
(
"input"
);
var
num
=
0
;
function
debounce
()
{
let
x
=
setTimeout
(()
=>
{
console
.
log
(
"Muhammad Amenn"
);
searching
.
style
.
display
=
"block"
},
1000
);
if
(
input
.
value
?.
length
>
0
)
{
let
x
=
setTimeout
(()
=>
{
console
.
log
(
"Muhammad Amenn"
);
searching
.
style
.
display
=
"block"
;
num
++
;
count
.
innerHTML
=
num
;
},
1000
);
clearTimeout
(
x
-
1
);
clearTimeout
(
x
-
1
);
}
}
let
searching
=
document
.
getElementById
(
"searching"
)
searching
.
style
.
display
=
"none"
inex.html
View file @
71e4de7d
...
...
@@ -14,8 +14,9 @@
oninput=
"debounce()"
class=
"input"
placeholder=
"Search Here"
id=
"input"
/>
<p
id=
"searching"
>
Searching........
</p>
<p
class=
"count"
id=
"searching"
>
Api Hit
<span
style=
"color: red; font-size: 30px;"
id=
"count"
>
0
</span>
</p>
</div>
<script
src=
"./app.js"
></script>
...
...
style.css
View file @
71e4de7d
...
...
@@ -19,3 +19,9 @@ body {
p
{
color
:
white
;
}
.count
{
font-size
:
24px
;
font-family
:
sans-serif
;
letter-spacing
:
2px
;
}
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