Jump to content

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?

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...