Javascript Text loop on click
up vote
-6
down vote
favorite
some Javascript code
that writes ten times the sentence “I know a bit of JavaScript” after clicking on a text within an tag. Your code should use a for loop or a while loop and if statements. You must use a function to write the sentence.
javascript loops for-loop if-statement while-loop
add a comment |
up vote
-6
down vote
favorite
some Javascript code
that writes ten times the sentence “I know a bit of JavaScript” after clicking on a text within an tag. Your code should use a for loop or a while loop and if statements. You must use a function to write the sentence.
javascript loops for-loop if-statement while-loop
The posted question does not appear to include any attempt at all to solve the problem. StackOverflow expects you to try to solve your own problem first, as your attempts help us to better understand what you want. Please edit the question to show what you've tried, so as to illustrate a specific roadblock you're running into a Minimal, Complete, and Verifiable example. For more information, please see How to Ask and take the tour.
– CertainPerformance
Nov 20 at 5:44
Why does this seem like word-for-word homework instructions?
– vol7ron
Nov 20 at 5:46
Literally just someone's homework...
– Jacin Tattersall
Nov 20 at 5:48
you can try that yourself. It just takes the basics of JavaScript.If you don't try this simple exercise then how you are going to learn programming
– RopAli Munshi
Nov 20 at 7:36
add a comment |
up vote
-6
down vote
favorite
up vote
-6
down vote
favorite
some Javascript code
that writes ten times the sentence “I know a bit of JavaScript” after clicking on a text within an tag. Your code should use a for loop or a while loop and if statements. You must use a function to write the sentence.
javascript loops for-loop if-statement while-loop
some Javascript code
that writes ten times the sentence “I know a bit of JavaScript” after clicking on a text within an tag. Your code should use a for loop or a while loop and if statements. You must use a function to write the sentence.
javascript loops for-loop if-statement while-loop
javascript loops for-loop if-statement while-loop
asked Nov 20 at 5:44
dioworld
1
1
The posted question does not appear to include any attempt at all to solve the problem. StackOverflow expects you to try to solve your own problem first, as your attempts help us to better understand what you want. Please edit the question to show what you've tried, so as to illustrate a specific roadblock you're running into a Minimal, Complete, and Verifiable example. For more information, please see How to Ask and take the tour.
– CertainPerformance
Nov 20 at 5:44
Why does this seem like word-for-word homework instructions?
– vol7ron
Nov 20 at 5:46
Literally just someone's homework...
– Jacin Tattersall
Nov 20 at 5:48
you can try that yourself. It just takes the basics of JavaScript.If you don't try this simple exercise then how you are going to learn programming
– RopAli Munshi
Nov 20 at 7:36
add a comment |
The posted question does not appear to include any attempt at all to solve the problem. StackOverflow expects you to try to solve your own problem first, as your attempts help us to better understand what you want. Please edit the question to show what you've tried, so as to illustrate a specific roadblock you're running into a Minimal, Complete, and Verifiable example. For more information, please see How to Ask and take the tour.
– CertainPerformance
Nov 20 at 5:44
Why does this seem like word-for-word homework instructions?
– vol7ron
Nov 20 at 5:46
Literally just someone's homework...
– Jacin Tattersall
Nov 20 at 5:48
you can try that yourself. It just takes the basics of JavaScript.If you don't try this simple exercise then how you are going to learn programming
– RopAli Munshi
Nov 20 at 7:36
The posted question does not appear to include any attempt at all to solve the problem. StackOverflow expects you to try to solve your own problem first, as your attempts help us to better understand what you want. Please edit the question to show what you've tried, so as to illustrate a specific roadblock you're running into a Minimal, Complete, and Verifiable example. For more information, please see How to Ask and take the tour.
– CertainPerformance
Nov 20 at 5:44
The posted question does not appear to include any attempt at all to solve the problem. StackOverflow expects you to try to solve your own problem first, as your attempts help us to better understand what you want. Please edit the question to show what you've tried, so as to illustrate a specific roadblock you're running into a Minimal, Complete, and Verifiable example. For more information, please see How to Ask and take the tour.
– CertainPerformance
Nov 20 at 5:44
Why does this seem like word-for-word homework instructions?
– vol7ron
Nov 20 at 5:46
Why does this seem like word-for-word homework instructions?
– vol7ron
Nov 20 at 5:46
Literally just someone's homework...
– Jacin Tattersall
Nov 20 at 5:48
Literally just someone's homework...
– Jacin Tattersall
Nov 20 at 5:48
you can try that yourself. It just takes the basics of JavaScript.If you don't try this simple exercise then how you are going to learn programming
– RopAli Munshi
Nov 20 at 7:36
you can try that yourself. It just takes the basics of JavaScript.If you don't try this simple exercise then how you are going to learn programming
– RopAli Munshi
Nov 20 at 7:36
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
I will not give you any code since this sounds like homework, but how about breaking the question down and googling every step of it.
Lets break it down:
Write ten times a sentace. Your code should use a loop.
Lets check what the JavaScript docs say about while loops :https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/whileClicking on a text within an tag:
Lets check what the JavaScript docs say about the click event:
https://developer.mozilla.org/en-US/docs/Web/Events/clickYou muse use a function to write the sentance
Lets check what the JavaScript docs say about functions
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Functions
So take it piece by piece. It doesn't have to to all the right things at once. Just break it down.
Try to make a while loop do something 10 times. Just to console.log('stuff') out. Just so that you see something happening 10 times.
Try to make a onClick event console.log('I got clicked'), just to make sure you have your event
Try to make a function do something.
When you have a function that does something, a loop that runs 10 times and an onClick event that fires then its just a matter of putting it all together.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
I will not give you any code since this sounds like homework, but how about breaking the question down and googling every step of it.
Lets break it down:
Write ten times a sentace. Your code should use a loop.
Lets check what the JavaScript docs say about while loops :https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/whileClicking on a text within an tag:
Lets check what the JavaScript docs say about the click event:
https://developer.mozilla.org/en-US/docs/Web/Events/clickYou muse use a function to write the sentance
Lets check what the JavaScript docs say about functions
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Functions
So take it piece by piece. It doesn't have to to all the right things at once. Just break it down.
Try to make a while loop do something 10 times. Just to console.log('stuff') out. Just so that you see something happening 10 times.
Try to make a onClick event console.log('I got clicked'), just to make sure you have your event
Try to make a function do something.
When you have a function that does something, a loop that runs 10 times and an onClick event that fires then its just a matter of putting it all together.
add a comment |
up vote
0
down vote
I will not give you any code since this sounds like homework, but how about breaking the question down and googling every step of it.
Lets break it down:
Write ten times a sentace. Your code should use a loop.
Lets check what the JavaScript docs say about while loops :https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/whileClicking on a text within an tag:
Lets check what the JavaScript docs say about the click event:
https://developer.mozilla.org/en-US/docs/Web/Events/clickYou muse use a function to write the sentance
Lets check what the JavaScript docs say about functions
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Functions
So take it piece by piece. It doesn't have to to all the right things at once. Just break it down.
Try to make a while loop do something 10 times. Just to console.log('stuff') out. Just so that you see something happening 10 times.
Try to make a onClick event console.log('I got clicked'), just to make sure you have your event
Try to make a function do something.
When you have a function that does something, a loop that runs 10 times and an onClick event that fires then its just a matter of putting it all together.
add a comment |
up vote
0
down vote
up vote
0
down vote
I will not give you any code since this sounds like homework, but how about breaking the question down and googling every step of it.
Lets break it down:
Write ten times a sentace. Your code should use a loop.
Lets check what the JavaScript docs say about while loops :https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/whileClicking on a text within an tag:
Lets check what the JavaScript docs say about the click event:
https://developer.mozilla.org/en-US/docs/Web/Events/clickYou muse use a function to write the sentance
Lets check what the JavaScript docs say about functions
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Functions
So take it piece by piece. It doesn't have to to all the right things at once. Just break it down.
Try to make a while loop do something 10 times. Just to console.log('stuff') out. Just so that you see something happening 10 times.
Try to make a onClick event console.log('I got clicked'), just to make sure you have your event
Try to make a function do something.
When you have a function that does something, a loop that runs 10 times and an onClick event that fires then its just a matter of putting it all together.
I will not give you any code since this sounds like homework, but how about breaking the question down and googling every step of it.
Lets break it down:
Write ten times a sentace. Your code should use a loop.
Lets check what the JavaScript docs say about while loops :https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/whileClicking on a text within an tag:
Lets check what the JavaScript docs say about the click event:
https://developer.mozilla.org/en-US/docs/Web/Events/clickYou muse use a function to write the sentance
Lets check what the JavaScript docs say about functions
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Functions
So take it piece by piece. It doesn't have to to all the right things at once. Just break it down.
Try to make a while loop do something 10 times. Just to console.log('stuff') out. Just so that you see something happening 10 times.
Try to make a onClick event console.log('I got clicked'), just to make sure you have your event
Try to make a function do something.
When you have a function that does something, a loop that runs 10 times and an onClick event that fires then its just a matter of putting it all together.
answered Dec 3 at 21:57
Bergur
814510
814510
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53386909%2fjavascript-text-loop-on-click%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
The posted question does not appear to include any attempt at all to solve the problem. StackOverflow expects you to try to solve your own problem first, as your attempts help us to better understand what you want. Please edit the question to show what you've tried, so as to illustrate a specific roadblock you're running into a Minimal, Complete, and Verifiable example. For more information, please see How to Ask and take the tour.
– CertainPerformance
Nov 20 at 5:44
Why does this seem like word-for-word homework instructions?
– vol7ron
Nov 20 at 5:46
Literally just someone's homework...
– Jacin Tattersall
Nov 20 at 5:48
you can try that yourself. It just takes the basics of JavaScript.If you don't try this simple exercise then how you are going to learn programming
– RopAli Munshi
Nov 20 at 7:36