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
8cbf7cb5
Commit
8cbf7cb5
authored
Jun 03, 2022
by
Muhammad Ameen
💻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some conditions add
parent
71e4de7d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
app.js
app.js
+9
-7
inex.html
inex.html
+1
-1
No files found.
app.js
View file @
8cbf7cb5
let
searching
=
document
.
getElementById
(
"searching"
);
let
count
=
document
.
getElementById
(
"count"
);
let
input
=
document
.
getElementById
(
"input"
);
var
num
=
0
;
let
num
=
0
;
let
preValVar
=
""
;
function
debounce
()
{
if
(
input
.
value
?
.
length
>
0
)
{
if
(
input
.
value
.
length
>
0
)
{
let
x
=
setTimeout
(()
=>
{
console
.
log
(
"Muhammad Amenn"
);
searching
.
style
.
display
=
"block"
;
num
++
;
count
.
innerHTML
=
num
;
if
(
input
.
value
!==
preValVar
)
{
console
.
log
(
input
.
value
==
preValVar
);
num
++
;
count
.
innerHTML
=
num
;
preValVar
=
input
.
value
;
}
},
1000
);
clearTimeout
(
x
-
1
);
}
}
inex.html
View file @
8cbf7cb5
...
...
@@ -16,7 +16,7 @@
placeholder=
"Search Here"
id=
"input"
/>
<p
class=
"count"
id=
"searching"
>
A
pi
Hit
<span
style=
"color: red; font-size: 30px;"
id=
"count"
>
0
</span></p>
<p
class=
"count"
id=
"searching"
>
A
PI
Hit
<span
style=
"color: red; font-size: 30px;"
id=
"count"
>
0
</span></p>
</div>
<script
src=
"./app.js"
></script>
...
...
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