Jenniferhhh
Badges: 2
Rep:
?
#1
Report Thread starter 4 years ago
#1
How do I activate a setInterval using a button then stop the button after time? Could someone give me some codes to do this?

Thank you.
0
reply
Jenniferhhh
Badges: 2
Rep:
?
#2
Report Thread starter 4 years ago
#2
BUMP
0
reply
Jenniferhhh
Badges: 2
Rep:
?
#3
Report Thread starter 4 years ago
#3
Bump
0
reply
Jenniferhhh
Badges: 2
Rep:
?
#4
Report Thread starter 4 years ago
#4
bump
0
reply
Jenniferhhh
Badges: 2
Rep:
?
#5
Report Thread starter 4 years ago
#5
I'll bump an infinite amount of times.
0
reply
_gcx
Badges: 21
Rep:
?
#6
Report 4 years ago
#6
(Original post by Jenniferhhh)
How do I activate a setInterval using a button then stop the button after time? Could someone give me some codes to do this?

Thank you.
At least post an attempt?
0
reply
Jenniferhhh
Badges: 2
Rep:
?
#7
Report Thread starter 4 years ago
#7
(Original post by _gcx)
At least post an attempt?
sure, wait a second.
0
reply
Jenniferhhh
Badges: 2
Rep:
?
#8
Report Thread starter 4 years ago
#8
<!DOCTYPE html>

<html>

<body>

<h1>X</h1>

<p>X</p>

<img id="X" src="X(URL)">

<button type="button" onclick="changeLights()">Change Lights</button>

<script>

var list = [

"X(URL.jpg)",

"X( URL.jpg",

"X(URL.jpg)",

"X(URL.jpg)"

];

var index = 0;

function changeLights() {

index = index + 1;

if (index == list.length) index = 0;

var image = document.getElementById('light');

image.src=list[index];

}

</script>

</body>

</html>

X is to keep it encrypted.
the ( URL) means that there is a URL in that tag.
0
reply
Jenniferhhh
Badges: 2
Rep:
?
#9
Report Thread starter 4 years ago
#9
(Original post by _gcx)
At least post an attempt?
done, look at the above post.
0
reply
Jenniferhhh
Badges: 2
Rep:
?
#10
Report Thread starter 4 years ago
#10
bump
0
reply
Jenniferhhh
Badges: 2
Rep:
?
#11
Report Thread starter 4 years ago
#11
bump, I will not stop bumbing
0
reply
Aklaol
Badges: 12
Rep:
?
#12
Report 4 years ago
#12
My god you're an absolute pest. I'm not even going to bother to help you let alone give you a solution. Stop bumping your post every minute, it's not doing you any favours.
0
reply
Jenniferhhh
Badges: 2
Rep:
?
#13
Report Thread starter 4 years ago
#13
(Original post by Aklaol)
My god you're an absolute pest. I'm not even going to bother to help you let alone give you a solution. Stop bumping your post every minute, it's not doing you any favours.
you probably didn't have a solution in the first place.
0
reply
Aklaol
Badges: 12
Rep:
?
#14
Report 4 years ago
#14
(Original post by Jenniferhhh)
you probably didn't have a solution in the first place.
Of course I don't? Why would I spend my time coming up with a solution for somebody who just spams "bump" on their post. I help those that deserve it.
0
reply
Jenniferhhh
Badges: 2
Rep:
?
#15
Report Thread starter 4 years ago
#15
(Original post by Aklaol)
Of course I don't? Why would I spend my time coming up with a solution for somebody who just spams "bump" on their post. I help those that deserve it.
haha haha
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

Do you think receiving Teacher Assessed Grades will impact your future?

I'm worried it will negatively impact me getting into university/college (43)
37.07%
I'm worried that I’m not academically prepared for the next stage in my educational journey (11)
9.48%
I'm worried it will impact my future career (5)
4.31%
I'm worried that my grades will be seen as ‘lesser’ because I didn’t take exams (29)
25%
I don’t think that receiving these grades will impact my future (18)
15.52%
I think that receiving these grades will affect me in another way (let us know in the discussion!) (10)
8.62%

Watched Threads

View All