Jump to content

loop creation


jimfog

Recommended Posts

I have created a loop that creates a dropdown menu, a menu of timestamps, for reasons of clarity though I have created this fiddle http://jsfiddle.net/fiddlehunt/5WVKz/ where the menu is comprised of numbers 1-10,

 

And here is the problem:

As you will see in the fiddle the append() method is used.

The problem is that whenever the function that creates the loop gets called...the created numbers are added to the numbers that where created with the previous function call.

 

So. when the menu is opened(and if for example the function has been called twice) I see two times 1-10.

 

Unfortunately I cannot replicate the behavior with jsfiddle.

 

How can I fix it?

Link to comment
Share on other sites

Yes,you are right.

 

I had tried it but the implementation/logic was wrong-I tried now a different logic and it worked.

Probably,creating a topic about it,was not even necessary.

Link to comment
Share on other sites

Probably,creating a topic about it,was not even necessary.

 

Sometimes it helps just to type it out, write it down, or say it out loud to help facilitate the problem solving process.

 

If you saw my notebook at work, you might think I was crazy.

Edited by Day
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...